Xml
- @drawable/image1
- @drawable/image2
- @drawable/image3
- @drawable/image4
- @drawable/image5
- @drawable/image6
- @drawable/image1
- @drawable/image2
- @drawable/image3
- @drawable/image4
- @drawable/image5
- @drawable/image6
Java
TypedArray ar = context.getResources().obtainTypedArray(R.array.images); int len = ar.length(); int[] resIds = new int[len]; for (int i = 0; i < len; i++) resIds[i] = ar.getResourceId(i, 0); ar.recycle();