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;
}
});
Android ExpandableListView长按事件,布布扣,bubuko.com
Android ExpandableListView长按事件
原文:http://www.cnblogs.com/suizi/p/3666539.html