Skip to content Skip to sidebar Skip to footer

How To Populate A Gridview Using An Imageadapter With A Drawable Array Stored In Xml

I am using the sample ImageAdpater provided in the google documentation to populate a gridview with drawables. What I'm trying to do is populate the gridview with an array of drawa

Solution 1:

I ended up solving this problem by using 'getResources().obtainTypedArray(R.array.log_type_icons);' to get the array in my main activity, then passed it to the image adapter instead of using 'getResources()' within the adapter

Solution 2:

I think this is the thread which is similar to your question. please check this.

Here they used custom array of drawables. you can try your resource drawable array in place of it

Post a Comment for "How To Populate A Gridview Using An Imageadapter With A Drawable Array Stored In Xml"