tags:

views:

2088

answers:

3

Hi, I want to add an image icon in expandable list view .I have seen the tutorial they have added only in child elements .Is there any other way to add image icon in parent Any help would be appreciated. Thanks in advance.

+1  A: 

You can try the setGroupIndicator(Drawable) method of ExpandableListView.

Dimitar Dimitrov
Hi, This method adds the icon to all the parent but if i want to add seperate icon for each parent respectively .Is it possible.
Sam97305421562
If you want to really customize your group layout, why don't you try using or subclassing SimpleExpandableListAdapter? Set custom resource for expandedGroupLayout, and load the image you need on getGroupView(int, boolean, View, ViewGroup). Good luck and comment back when you see/try it.
Dimitar Dimitrov
A: 

Pls give me an example

raj
A: 

ok

   public View getGroupView(int groupPosition, boolean isExpanded, View convertView,
            ViewGroup parent) {

    if(getChildrenCount(groupPosition)==0)
    {
          // how do i hide the group indicator ?

    }

So, how can modify the group indicator for empty groups ?

superseed77