开发者

Android - Display image that is of type file

开发者 https://www.devze.com 2022-12-29 09:49 出处:网络
I have an image that is 开发者_如何学运维currently stored in variable of type \"File\".. File img = ...;

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);
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号