ABOUT ME

-

Today
-
Yesterday
-
Total
-
  • ExpandableListView setOnItemLongClickListener
    카테고리 없음 2011. 4. 1. 11:12

    mExpandableListView.setOnItemLongClickListener(new OnItemLongClickListener() {

                @Override
                public boolean onItemLongClick(AdapterView<?> arg0, View arg1, int position, long arg3) {                
                    
                    
                    long packedPosition =  mExpandableListView.getExpandableListPosition(position);
                    int type = ExpandableListView.getPackedPositionType(packedPosition);
                    
                    Log.i(TAG, "type = "  + type );
                    
                    //check the type
                    if(type == ExpandableListView.PACKED_POSITION_TYPE_CHILD){
                        int groupPos = ExpandableListView.getPackedPositionGroup(position);
                        int childPos = ExpandableListView.getPackedPositionChild(position);
                        deleteAlertDialog(groupPos,childPos);
                    }
                    
                    return false;
                }
            });


Designed by Tistory.