expandableListView.setOnItemLongClickListener(new
OnItemLongClickListener(){
@Override
public boolean
onItemLongClick(AdapterView<?> arg0, View arg1,
int arg2, long
arg3) {
// TODO
Auto-generated method stub
if(ExpandableListView.getPackedPositionType(arg3)==ExpandableListView.PACKED_POSITION_TYPE_CHILD){
long packPos =
((ExpandableListView) arg0).getExpandableListPosition(arg2);
int
groupPosition=ExpandableListView.getPackedPositionGroup(packPos);
int
childPosition=
ExpandableListView.getPackedPositionChild(packPos);
System.out.println("------------------------------->"+groupPosition);
System.out.println("--------------------------------------->"+childPosition);
return
true;
}else
if(ExpandableListView.getPackedPositionType(arg3)==ExpandableListView.PACKED_POSITION_TYPE_GROUP){
long packPos =
((ExpandableListView)arg0).getExpandableListPosition(arg2);
int
groupPosition=ExpandableListView.getPackedPositionGroup(packPos);
int
childPosition=
ExpandableListView.getPackedPositionChild(packPos);
System.out.println("-------------------++++++++++++++------------>"+groupPosition);
System.out.println("-----------------------++++++++++++++---------------->"+childPosition);
}
return false;
}
});
相关文章
- 03-30在辅助功能Android中无法使用TYPE_WINDOWS_CHANGED事件
- 03-30android 系统日历 插入重复事件规则 RRULE
- 03-30ANDROID:如何从所有窗口顶部的通知或长按搜索按钮启动弹出对话框?
- 03-30android – Cordova 3.4 – 检测键盘事件
- 03-30Android – 处理虚拟和物理键盘事件
- 03-30跟我学android之四 事件驱动模型
- 03-30Android 的点击事件你知道有几种?
- 03-30android-使用嵌套的viewpagers将触摸事件委托给父级
- 03-30android-将触摸事件调度到同级视图
- 03-30如何在Zoom Android中应用长按并捏一下?