android 10 BitmapFactory.decodeFile(ImageFilePath) return null

前端 未结 1 1057
误落风尘
误落风尘 2021-01-17 06:29

I\'m building an android application which allow user to pick Image from camera or From Gallery then display the image in a Imageview.My application working fine if the user

相关标签:
1条回答
  • 2021-01-17 06:36
    InputStream is = getContentResolver().openInputStream(data.getData());
    
    Bitmap bitmap = BitmapFactory.decodeStream(is);
    

    Use this for all Android versions.

    Stop with trying to get a path for an uri.

    0 讨论(0)
提交回复
热议问题