Android which button index from array was pressed

Posted by Tim Wayne on Stack Overflow See other posts from Stack Overflow or by Tim Wayne
Published on 2010-03-14T20:52:25Z Indexed on 2010/03/14 20:55 UTC
Read the original article Hit count: 243

Filed under:
|
|

How do I set up a OnClickListener to simply tell me which index button was pressed from an array of buttons. I can change text and color of these buttons using the array. I set them up like this.

 TButton[1] = (Button)findViewById(R.id.Button01);
 TButton[2] = (Button)findViewById(R.id.Button02);
 TButton[3] = (Button)findViewById(R.id.Button03);

up to 36.

© Stack Overflow or respective owner

Related posts about android

Related posts about buttons