开发者

how to display images stored in application directory

开发者 https://www.devze.com 2023-02-20 00:02 出处:网络
how to display images stored in \"/data/data/c开发者_运维百科om.package/images/\" directory in a GridView.Step 1) Create a bitmap drawable from the file:

how to display images stored in "/data/data/c开发者_运维百科om.package/images/" directory in a GridView.


Step 1) Create a bitmap drawable from the file:

BitmapDrawable d = BitmapDrawable.createFromPath("path");

Step 2) set this drawable on the image view of the corresponding grid item.

ImageView iv = new ImageView(this);
iv.setImageDrawable(drawable);

On how to set imageview in grid view, please refer to this link:

http://developer.android.com/guide/tutorials/views/hello-gridview.html

0

精彩评论

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