Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

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.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9167895
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:30:08+00:00 2026-06-17T15:30:08+00:00

Is there a way to show expandable and non expandable list in the same

  • 0

Is there a way to show expandable and non expandable list in the same list view?
What I am trying to achieve is to have expandable list view but for items that don’t have sub items, and I don’t want to show the arrow expand arrow icon
How how can I do that? Please help
Thanks

EDIT: All what I want is to be able to hide indicator arrow when group is empty

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T15:30:09+00:00Added an answer on June 17, 2026 at 3:30 pm

    1) Basically, you have to hide “expand arrow” when group has no child.
    You can achieve this by setting GroupIndicator property to null.

    For ex : getExpandableListView().setGroupIndicator(null);

    OR

    2) by checking the children count you can set the indicator like the below code,

       if ( getChildrenCount( groupPosition ) == 0 ) {
           indicator.setVisibility( View.INVISIBLE );
        } else {
           indicator.setVisibility( View.VISIBLE );
           indicator.setImageResource( isExpanded ? R.drawable.list_group_expanded : R.drawable.list_group_closed );
        }
    

    For more information about hiding Group indicator, you can refer this link.

    OR

    3) Create a group_indicator.xml file in drawable folder

    <item android:state_empty="true" android:drawable="@android:color/transparent"></item>
    <item android:state_expanded="true" android:drawable="@drawable/arrowdown"></item>
    <item android:drawable="@drawable/arrowright"></item>
    

    Then, define expandable list view like the below code,

       <ExpandableListView
            android:id="@+id/android:list"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:groupIndicator="@drawable/group_indicator"
            android:layout_weight="1" >
        </ExpandableListView>
    

    Hope this will solve your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there a way to show all tables that have a specific number of
Is there a way to show all the shortcut keys that have been defined
Is there a way to show the SQL that Django is running while performing
Is there any way to show errors not on top of form page, but
Is there any way to show an icon in a table view when a
Is there any way to show local tasks to user if they doesn't have
Is there a way to show the SQL statement that has just been ociparse'd
Is there a way to show all classes that implement a certain method from
Is there a way to show Divider between the Menu Items in ActionBar for
Is there any way to show data in the grid view form in ipad

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.