0
写真を撮ってからimageViewに表示するアプリがありますが、問題はAndroid 1または7.1.1にあります。他の携帯電話は完全に動作しています(Samsung S7 Edge Nougat 7.0.0、Nexus 5X Marshmallow 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;
}
}