Question

I need to create a GridView full of Buttons, each labelled with text from a query.

Which Adapter should I use? A ResourceCursorAdapter, a SimpleCursorAdapater or something else?

(SimpleCursorAdpater seems like it would do the job, except I can't work out how to tell it to put the colum values as an attribute of the button, rather than the content.)

Was it helpful?

Solution

If the you're looking to handle the actual click event of the button (and not the actual parent grid item), I would just extend CursorAdapter and write your own custom CursorAdapter. Inflate your own layout containing the button, set the text, and set the click event.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top