Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试将 /mnt/sdcard/img.jpg 中的图像读入 ImageView。
Bitmap bm = BitmapFactory.decodeFile("/mnt/sdcard/img.jpg"); imageView1.setImageBitmap(bm);
我有写外部存储权限。
但是 ImageView 是空的,LogCat 没有任何错误,
我该如何解决?
尝试
File file = new File("/mnt/sdcard/img.jpg"); Bitmap bitmap = BitmapFactory.decodeFile(file.getAbsolutePath()); imageview1.setImageBitmap(bitmap);