简体   繁体   中英

Create image gallery from drawable

I'm trying to create app that shows image from drawable, eg gallery application. I`m using this guide link guide , but I want show images from drawable resources, not from SD card. Can you give me some advice what I need change in this code, I guess I should change in Utils.class. Sorry for my English and Im newbie android dev

Define the drawables in an array 
int[] myImageList = new int[]{R.drawable.thingOne,      R.drawable.thingTwo};

later... access them like this based on position myImageView.setImageResource(myimagelist[i]);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM