Android - Display image that is of type file
I have an image that is 开发者_如何学运维currently stored in variable of type "File"..
File img = ...;
What is the easiest way to display this image onto the screen so I can verify it is working correct?
Thanks!
If you have an ImageView in your layout, you can do something like this, assuming you have a reference to your ImageView named view
:
Drawable d = Drawable.createFromPath(img);
image.setImageDrawable(d);
精彩评论