Android编程之View添加Listener的小技巧
2010-08-11 10:39:00 来源:WEB开发网核心提示:10. public void onCreate(Bundle savedInstanceState) {11. super.onCreate(savedInstanceState);12. setContentView(R.layout.main);13. }14. public void myClickHandle
10. public void onCreate(Bundle savedInstanceState) {
11. super.onCreate(savedInstanceState);
12. setContentView(R.layout.main);
13. }
14. public void myClickHandler(View target){
15. switch (target.getId()) {
16. case R.id.Button01:
17. setTitle("myClickHandler01");
18. break;
19. case R.id.Button02:
20. setTitle("myClickHandler02");
21. break;
22. }
23. }
24. }
更多精彩
赞助商链接