I have 100+ images to load into a listView, and I am trying to store all the resId into an int[]. I can done it from drawable by using the below code
Field[] ID_Fields = R.drawable.class.getFields();
resArray = new int[ID_Fields.length];
for(int i = 0; i < ID_Fields.length; i++)
{
try {
resArray[i] = ID_Fields[i].getInt(null);
} catch (IllegalArgumentException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
} catch (IllegalAccessException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
}
But my problem is that I don't need all images in the drawable folder for my listView. So can i create a folder inside the asset and get all resId into a int[] ? or can I use raw folder for this? Any help will be appreciated.