How to get an image icon which is defined in a resourses file into an activity
posted 3 years ago
I've defined some code like below which is in a file called icons, under layout folder which is kind of resources
and I want to retrieve it into a class which is kind of ListActivity and put it in an array, then put the array of these icons as a small pic on each item of the ListView. for example in the code below which I wrote in the class that extends from ListActivity, I've defined an array of country_icons in the file that I mentioned which is kind of resources
and put them in the TypedArray . but now I want some expression like TypedArray icons = res.obtainTypedArray(R.array.country_icons); to get the above icon from that and create a new array in the ListActivity class and then put the array as an argument of ImageAndTextAdapter() instead of icons parameter in the below code!