码迷,mamicode.com
首页 > 其他好文 > 详细

ViewUtils

时间:2015-12-13 18:41:56      阅读:178      评论:0      收藏:0      [点我收藏+]

标签:

 1 @ViewInject(R.id.btn)  
 2 private Button btn;  
 3   
 4 @ViewInject(R.id.img)  
 5 private ImageView img;  
 6   
 7 @ViewInject(R.id.list)  
 8 private ListView list;  
 9 
10 @OnClick(R.id.btn_play)
11 private void clickBtn(View v)
12 {
13     Toast.makeText(this, "hahah", Toast.LENGTH_LONG).show();
14 }
15 
16 @OnItemClick(R.id.list)  
17 private void itemClick(AdapterView<?> parent, View view, int position,long id) 
18 {  
19     Toast.makeText(SecondActivity.this, "position--->" + position,  
20             Toast.LENGTH_SHORT).show();  
21 } 
22 
23 //xUtils提供onClick、onItemClick、onLongClick等15种事件监听注解.
24 
25 @OnClick({R.id.btn_start, R.id.btn_pause, R.id.btn_stop})
26 private void clickMethod(View v)
27 {
28     switch (v.getId())
29     {
30         case R.id.btn_start:
31             Log.e("....", "..............");
32             break;
33         //........
34     }
35 }
36         
37 @Override  
38 protected void onCreate(Bundle savedInstanceState) 
39 {  
40     super.onCreate(savedInstanceState);  
41     setContentView(R.layout.activity_second);  
42     ViewUtils.inject(this);//TODO inject    vt. 注入;注射
43     //......
44     
45 }  

 

ViewUtils

标签:

原文地址:http://www.cnblogs.com/starman/p/5043259.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!