Disable onClick highlighting for one group in an expandable list?

I have a ExpandableListView

supported implementation BaseExpandableListAdapter

. The first group on the list functions as a title and does not expand. I set isChildSelectable()

to return false for this group and everything works fine. However, when the user clicks on this group with no extension, the UI still highlights the row. This is a confusing and unnecessary visual signal that I would like to eliminate.

I cannot set android: listSelector = "@android: color / transparent" on the ExpandableListView itself because I want the other list items to be highlighted on click and expand.

Is it possible to turn off click highlighting for this first group (only)?

+3


source to share


1 answer


Try setting an individual parent view OnClickListener

to null

from getGroupView()

.



View getGroupView(int groupPosition, boolean isExpanded, View convertView,
            ViewGroup parent) {
    ...
    convertView.setOnClickListener(null);
    ...
}

      

0


source







All Articles