【发布时间】:2013-09-15 13:12:54
【问题描述】:
Toast.makeText(this, Environment.getExternalStorageDirectory(),
Toast.LENGTH_LONG).show();
File file = new File(Environment.getExternalStorageDirectory() +
"/whatsupv2/abc.jpg");
Bitmap mybitmap = BitmapFactory.decodeFile(file.getAbsolutePath());
imageView.setImageURI(Uri.fromFile(file));
上面的代码适用于 android 3.3,但不适用于 4.1.2,我们有两个存储目录...我检查了 abc.jpg 是否存在于 dir.. 并且给出的路径是正确的.. 但 imageview 只显示一个白屏..
【问题讨论】:
-
你解决了这个问题吗?我也面临同样的问题。
标签: android file bitmap imageview