标签:
[Android]在Adapter的getView方法中绑定OnClickListener比较好的方法
查看完整文章:http://www.cnblogs.com/tiantianbyconan/p/4146512.html
来自:
“https://github.com/wangjiegulu/AndroidBucket/blob/master/src/com/wangjie/androidbucket/
1
2
3
4
5
6
7
8
9
10
11
12
13
|
public
View getView( int
positon, View convertView, ViewGroup parent){ if ( null
== convertView){ convertView = LayoutInflater.from(context).inflate(R.layout.item,
null ); Button button = ABViewUtil.obtainView(convertView, R.id.item_btn);
button.setOnClickListener( new
OnConvertViewClickListener(convertView, R.id.ab__id_adapter_item_position){
@Override
public void
onClickCallBack(View registedView, int ... positionIds){
Toast.makeText(context, "position: "
+ positionIds[ 0 ], Toast.LENGTH_SHORT).show();
} });
}
convertView.setTag(R.id.ab__id_adapter_item_position, position);
} |
[Android]在Adapter的getView方法中绑定OnClickListener比较好的方法
标签:
原文地址:http://blog.csdn.net/u014311051/article/details/42268783