开发者

What is the most efficient way to load my stored JPG file into the ImageView?

开发者 https://www.devze.com 2023-01-15 07:49 出处:网络
I have valid JPG files and now I want to load them into a layout containing an ImageView.I have code to findView开发者_运维百科Id(R.id.myimage).I followed some sample code using File but it did not wo

I have valid JPG files and now I want to load them into a layout containing an ImageView. I have code to findView开发者_运维百科Id(R.id.myimage). I followed some sample code using File but it did not work. The file is stored at /data/data/com.myapp/files/someimage.jpg.

What is the easiest and efficient way to load and display?


((ImageView)view).setImageBitmap(BitmapFactory.decodeFile("/data/data/com.myapp/files/someimage.jpg"));

With the few info you give that's all I can do.

0

精彩评论

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