【发布时间】:2012-08-12 12:06:56
【问题描述】:
我首先以这种方式将图像存储在内部存储中:
FileOutputStream fos = context.openFileOutput("myimage.png", Context.MODE_PRIVATE);
bitmap.compress(CompressFormat.PNG, 100, fos);
fos.close();
然后我以这种方式将其显示在 ImageView 中:
File filepath = context.getFileStreamPath("myimage.png");
Uri uri = Uri.parse(filepath.toString());
myImageView.setImageUri(uri);
但图像从未出现在ImageView 中。由于某些限制,我不能在这里使用setImageBitmap()。谁能告诉我哪里出错了?
感谢您的帮助!
【问题讨论】:
标签: android uri android-imageview android-file