I use a ExpandableListView
in my Android application an want to perfrom an action if the user clicks long on the group element, so I defined a OnLongClickListener
in my BaseExpandableListAdapter
extention. The listener works as aspected but the child elements does not expand anymore. Any ideas?
public class ConnectionAdapter extends BaseExpandableListAdapter {
...
public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
ViewGroup parent) {
// convertView is a LinearLayout
convertView.setOnLongClickListener(new OnLongClickListener() {
public boolean onLongClick(View v) {
// my action here
return true;
}
});
}
...
}
The reason that your code is not further processing any other 'onClick' events is because you are passing a 'true' in your return. If you indicate that an event was handled, the OS stops attempting to further process any further events. To have it process THIS event, and also expand, then you need to change the return to false instead of true