【发布时间】:2015-09-18 05:22:51
【问题描述】:
这个我已经保存图像的内部存储器的屏幕截图。
我想在图像视图中读取图像。那么如何获取图像路径或如何从内存中读取图像?
请帮帮我..
我尝试了一些代码,但它不起作用:-
FileInputStream fis;
String filePath = activity.getFilesDir().getPath();
String path = data.get(position).get("product_image");
fis = openFileInput(filePath+"/broccolicasserole.jpg");
Bitmap bitmapA = BitmapFactory.decodeStream(fis);
producticon.setImageBitmap(bitmapA);
图像名称是从数据库中获取的,例如 :-data.get(position).get("product_image");
也试试这个代码:-
> String filePath = activity.getFilesDir().getPath();
File filePath1 = imageLoader.DisplayImage(filePath+data.get(position).get("product_image"), producticon);
【问题讨论】:
-
你想从图库中获取图片吗?
-
您将图像路径保存在应用中的哪个位置? @tej
-
@mono :- 是的,在我的内部存储中。请查看 DDMS 的屏幕截图
-
@amarbir Singh:- 不..我希望图像显示在 imageview 的列表视图中
-
您点击了哪个图片??然后获取要保存的图片的路径。
标签: android