ExpandableListview中包含很多子条目项,每个子条目项中拥有一个按钮,现在想获取这个按钮的点击事件,谁能只带你一下
解决方案 »
- 求助,关于字符串的拼音排序.
- 在listview填加文字图片功能
- Androis Log 输出到什么目录什么文件中?
- Android程序的问题(江湖救急!!!!)
- 请问android 魔塔游戏怎么设计暗墙
- android里边怎么在程序安装的时候执行创建数据库的操作
- 求解决一个利用HttpClient4用post连接服务器的问题,已经可以读服务器,服务器却不能收到post参数
- 虚拟机打开不了,求大神!
- android中如何根据已知的多点画出弧度曲线
- Android APP更新问题
- eclipse 真机调试时,File Exploer下没有文件夹
- 在ExpandableListView中子item中有两个按钮,要如何监听呢?
...
...
@Override
public View getChildView(int groupPosition, int childPosition,
boolean isLastChild, View convertView, ViewGroup parent) { View view = null; if (null != convertView) {
view = convertView;
} else {
view = View.inflate(context, R.layout.childview, null);
} Button button = (Button) view.findViewById(R.id.video_cover);
button .setOnClickListener(listener);
return view;
}
}
http://blog.csdn.net/lk_blog/article/details/7562987ExpandableListView实例(二)_两种方式实现QQ中组后面显示子条目数量效果
http://blog.csdn.net/lk_blog/article/details/7563355ExpandableListView实例(三)_实现QQ中"未分组"效果和"未分组"不可编辑删除功能
http://blog.csdn.net/lk_blog/article/details/7563371
@Override
public boolean onChildClick(ExpandableListView parent, View v,
int groupPosition, int childPosition, long id) {
//TODO
return true;
// must return false for handle this event by the super listener
// ,or true for not
}
});长按事件
view.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
try {
ExpandableListView.ExpandableListContextMenuInfo info
= (ExpandableListView.ExpandableListContextMenuInfo) menuInfo;
int type = ExpandableListView
.getPackedPositionType(info.packedPosition);
int group = ExpandableListView
.getPackedPositionGroup(info.packedPosition);
int child = ExpandableListView
.getPackedPositionChild(info.packedPosition);
if (type == ExpandableListView.PACKED_POSITION_TYPE_CHILD) {
//TODO