[android-developers] Creating integer array of resource ids

2011-03-18 Thread droid-stricken
Hi All, I have some images in my res/drawable folder. Let's say img1.png, img2.png and img3.png I am currently creating an int array of these image IDs in Java like this - int[] imgIds = {R.drawable.img1, R.drawable.img2, R.drawable.img3}; Instead is it possible to create an int arr in one of

Re: [android-developers] Creating integer array of resource ids

2011-03-18 Thread Marcin Orlowski
On 18 March 2011 02:20, droid-stricken harik...@gmail.com wrote: Hi All, I have some images in my res/drawable folder. Let's say img1.png, img2.png and img3.png I am currently creating an int array of these image IDs in Java like this - int[] imgIds = {R.drawable.img1, R.drawable.img2,

Re: [android-developers] Creating integer array of resource ids

2011-03-18 Thread Kostya Vasilyev
You're almost there, but values should be retrieved a little differently, not with getIntArray: Resources res = getResources(); TypedArray arr = res.obtainTypedArray(R.array.your_array_id_here); Drawable d = arr.getDrawable(2); -- Kostya 18.03.2011 19:32, Marcin