twirain
V2EX  ›  Android

新手遇到的 Android 问题,求指点

  •  
  •   twirain · Jul 28, 2018 · 12304 views
    This topic created in 2863 days ago, the information mentioned may be changed or developed.

    今天在一个自己的小 app 上搞开启相机拍照并返回图片
    GUIDE 文档中提到

    注:当您使用 ACTION_IMAGE_CAPTURE 拍摄照片时,相机可能还会在结果 Intent 中返回缩小尺寸的照片副本(缩略图),这个副本以 Bitmap 形式保存在名为 "data" 的 extra 字段中

    onActivityResult()里用Bitmap thumbnail = data.getParcelableExtra("data")
    发现取出来是 null 值,追进去发现getParcelableExtra()里什么都没有,这是为什么?

    intent.putExtra(MediaStore.EXTRA_OUTPUT, mImageUri)也一样,里面什么都没有, 断点看它进了 Bundle, BaseBundle,请问它是怎么跳转的???

    twirain
        1
    twirain  
    OP
       Jul 28, 2018
    傻逼了,原来 gradle 配置的时候是 API 28,而 28 还没开放 sources,改 27 解决。
    此贴终结。。
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2564 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 28ms · UTC 11:15 · PVG 19:15 · LAX 04:15 · JFK 07:15
    ♥ Do have faith in what you're doing.