长按ExpandableListView中的选项
来源:互联网 发布:音乐后期软件 编辑:程序博客网 时间:2024/05/16 16:24
此乃同事编写
这个扩展ListView是仿QQ的
group--分组--好友分组
child--子项--friend
@Override
public void onCreateContextMenu(ContextMenu menu, View v,
ContextMenuInfo menuInfo) {
super.onCreateContextMenu(menu, v, menuInfo);
ExpandableListView.ExpandableListContextMenuInfo info = (ExpandableListView.ExpandableListContextMenuInfo) menuInfo;
//menuinfo该对象提供了选中对象的附加信息
int type = ExpandableListView
.getPackedPositionType(info.packedPosition);
int group = ExpandableListView
.getPackedPositionGroup(info.packedPosition);
int child = ExpandableListView
.getPackedPositionChild(info.packedPosition);
System.out.println("LongClickListener*type-------------------------"
+ type);
System.out.println("LongClickListener*group-------------------------"
+ group);
System.out.println("LongClickListener*child-------------------------"
+ child);
this.setMGroupID(group);
this.setMChildrenID(child);
//响应
if (type == 0) {// 分组长按事件
showDialog(Globals.DIALOG_GROUPS_LONGCLICK);
} else if (type == 1) {// 长按好友列表项
showDialog(Globals.DIALOG_FRIENDlIST_LONGCLICK);
}
}
//一般在此函数下面编写响应事件
@Override
public boolean onContextItemSelected(MenuItem item) {
return super.onContextItemSelected(item);
}
- 长按ExpandableListView中的选项
- ExpandableListView 长按实现
- ExpandableListView 长按事件
- ExpandableListView长按事件
- ExpandableListView 长按事件
- 使用ExpandableListView——当有Group选项展开时,如何正确获取长按的Group选项。
- Android ExpandableListView长按事件
- ExpandableListView长按监听实现
- LISTVIEW 长按 选项
- Android ExpandableListView长按事件完美解决
- Android ExpandableListView长按事件解决方法一
- ExpandableListView长按事件解决方法二
- Android ExpandableListView长按事件完美解决
- 完美解决ExpandableListView长按点击事件
- ExpandableListView长按事件完美解决
- Android ExpandableListView长按事件完美解决
- Android ExpandableListView长按事件完美解决
- 【ExpandableListView】---2 长按和点击处理
- android 上下文菜单Context Menu
- java复习--关于反射的分析
- struts2标签
- AlertDialog 使用string中的内容作为dialog的item
- Dialog的使用:onCreateDialog showDialog
- 长按ExpandableListView中的选项
- dialog大全
- 好好陪父母
- 日期类加减及Java中日期类操作算法大全 (转)
- 临界区对象
- 互锁函数
- 仿Google分页的经典案例
- 泛型的简单介绍
- 内省的简单介绍