Advertisement
Guest User

Untitled

a guest
Apr 18th, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. btn0 = (Button) findViewById(R.id.btn0);
  2. btn1 = (Button) findViewById(R.id.btn1);
  3. btn2 = (Button) findViewById(R.id.btn2);
  4. btn3 = (Button) findViewById(R.id.btn3);
  5. btn4 = (Button) findViewById(R.id.btn4);
  6.  
  7. btn0.setOnClickListener(mButton_handler);
  8. btn1.setOnClickListener(mButton_handler);
  9. btn2.setOnClickListener(mButton_handler);
  10. btn3.setOnClickListener(mButton_handler);
  11. btn4.setOnClickListener(mButton_handler);
  12.  
  13. Button[] arr = new Button[5];
  14. arr[0] = btn0;
  15. ...
  16.  
  17. for(Button b in arr){
  18. b.setOnClickListener(mButton_handler);
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement