简体   繁体   English

如何从可写文件夹加载图像并分配到Android中的ImageView?

[英]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.

相关问题 如何从类路径加载Android ImageView的图像? - How to load image for Android ImageView from classpath? 如何从android imageview中的dataurl加载图像? - How to load an image from dataurl in android imageview? 如何使用滑动将GIF图像从可绘制文件夹加载到ImageView中? - How to load GIF image from drawable folder into ImageView using glide? 如何在Dropbox的Camera Upload文件夹中将图像设置为Android中的ImageView? - How to Set image from Camera upload folder of dropbox to ImageView in android? Android:无法读取资源文件夹中的图像并分配给imageview - Android : cannot read image in assets folder and assign to imageview 如何在Android中使用String将图像资源分配给ImageView - How to assign Image Resource to ImageView with String in Android 如何从Android中的URL将图像加载到动态创建的imageview中? - How to load a image into dynamically created imageview from a URL in android? 如何使用“ setImageURI”功能将图像从数据库加载到android ImageView中? - How to load image from database into android ImageView using “setImageURI” function? 如何在Android中从URL加载没有文件扩展名的图像到ImageView - How to load image without file extension from URL to ImageView in Android 如何从本地主机服务器加载图像到 imageview android - how to load image from localhost server into imageview android
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM