android adding buttons to gridview
I'm new to android programming. I'm trying to make 2x2 matriks using gridview and each spot has a button..
my questions are :
how to add the buttons ?
H开发者_StackOverflow中文版ow to declare the UI layout ?
how to set the click listener to each button ?
THX for the help
Basically you need to associated an Adapter with your GridView that will keep track of the data/contents of the view. And from the getView() of your Adapter you return the type of View that you want (Button in this case) and handle button selection etc.
Check out the Hello-GridView example for a better undersatnding
精彩评论