从 drawable 创建图库

Create image gallery from drawable

我正在尝试创建显示可绘制图像的应用程序,例如图库应用程序。我正在使用本指南 link guide,但我想显示来自可绘制资源的图像,而不是来自 SD 卡的图像。你能给我一些建议吗,我需要更改此代码,我想我应该更改 Utils.class。抱歉我的英语和我是新手 android dev

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

稍后...根据位置像这样访问它们 myImageView.setImageResource(myimagelist[i]);