ExpandableListView not expanding
I used below code to set onGroupClickListener in MainActivity and I also
set the OnLongClickListener to view within getGroupView() of my Custom
adapter named MyExpandableListAdapter. And then when i run the program
onGroupClickListener never fire either i return true or false from the
OnGroupClickListener() .If i remove OnlongClickListener from
getGroupView() program run normally and onGroupClickListener() will fire!
What's happening here and how to solve? If no that mean there is no way to
set longClickListener to groups of a ExpandableListView?!!!Here is the
code for OnGroupClickListener() in MainActivity
exListView.setOnGroupClickListener(new OnGroupClickListener(){
@Override
public boolean onGroupClick(ExpandableListView parent, View v,
int groupPosition, long id) {
gallery.setAdapter(new
ImageAdapter(getBaseContext(),(Bitmap[])
exListAdapter.getChild(groupPosition, 7)));
lastClickedGroup=groupPosition;
return false;
}
});
and here is the code for long press in MyExpandableListAdapter:
arg2.setOnLongClickListener(new OnLongClickListener(){
@Override
public boolean onLongClick(View view) {
DetailDialog.getDialog(screen.getContext(),(String)getChild(arg0,5));
return true;
}
});
No comments:
Post a Comment