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;
}
}