Is there an API or any official way to remove the group indicator for the item which does not has children when use a CursorTreeAdapter for a ExpandableListView?
Help! thanks a lot.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I struggled with this thing for a long time, the way I ended up doing it was to hide completely the GroupIndicator from the ExpandableListView
Then I created a Custom adapter extending BaseExpandableListAdapter, and implemented the getGroupView method, inside this method you can create a View with an ImageView that you can switch manually to expand or contract the group (using the isExpanded flag), and hide it completely if the group was empty.
http://developer.android.com/reference/android/widget/ExpandableListAdapter.html#getGroupView(int, boolean, android.view.View, android.view.ViewGroup)