[英]How to load image from writeable folder and assign to ImageView in Android?
App save images to writeable folder and content is loaded in into a BufferedReader
and want to assign it a an ImageView
. 应用程序将图像保存到可写文件夹,并将内容加载到
BufferedReader
并希望为其分配一个ImageView
。 What is the right approach to do it? 这样做的正确方法是什么?
File file = new File(context.getFilesDir(), body + ".image");
BufferedReader in = new BufferedReader(new FileReader(file));
ImageView icon = (ImageView) view.findViewById(R.id.icon);
icon. //What comes to here?
Bitmap bitmap = BitmapFactory.decodeFile(pathName);
icon.setImageBitmap(bitmap);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.