0
我有一個應用程序,需要照片然後顯示在imageView上,但問題是在Android的一個或7.1.1牛軋糖手機不顯示屏幕上的圖像,其他手機工作完美(它可以在三星S7邊緣牛軋糖7.0.0和Nexus 5X棉花糖6.0.0完美。)注意:它不是在7.1.1崩潰,只是沒有顯示並在屏幕上顯示圖像。在拍照後ImageView.setImageBitmap(bla)功能不適用於Android One Nougat 7.1.1
代碼示例:
if (requestCode == REQUEST_TAKE_PHOTO && resultCode == RESULT_OK) {
// Show the thumbnail on ImageView
Uri imageUri = Uri.parse(mCurrentPhotoPath);
File file = new File(imageUri.getPath());
try {
InputStream ims = new FileInputStream(file);
binding.ivPhoto.setImageBitmap(BitmapFactory.decodeStream(ims));
} catch (FileNotFoundException e) {
return;
}
}