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 6880403
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:58:10+00:00 2026-05-27T04:58:10+00:00

I’m currently working on a project in which I need something like the following:

  • 0

I’m currently working on a project in which I need something like the following:

- MainGroup 1 (Expandable)
  - SubGroup 1 (Expandable)
    - SubSubGroup 1 (Expandable)
      - Child View
      - Child View
      - ...
    - SubSubGroup 2 (Expandable)
      - Child View
      - Child View
      - ...
  - SubGroup 2 (Expandable)
    - SubSubGroup 3 (Expandable)
      - Child View
      - ...
    - SubSubGroup 4 (Expandable)
      - Child View
      - ...
  - SubGroup 3 (Expandable)
    - Child View
    - ...
- MainGroup 2 (Expandable)
  - ...

At most it would be an ExpandableListView inside an ExpandableListView inside an ExpandableListView – so 3 layers of ExpandableListView:

  • MainGroup would only hold other ExpandableListView.
  • SubGroup would hold other ExpandableListView except for the last two, which will allways just be ChildViews. (I’m thinking those two could just be substituted with the one for SubSubGroup)
  • SubSubGroup would allways hold ChildViews.

My problem is that I think I fail to understand the basic principles of how the ExpandableListView layouts it’s children. I’ve looked at examples like this, but can’t get my head around the functionality.

I’ve tried simply adding an ExpandableListView as a child in another – but something doesn’t work as only the first item of the inner ExpandableListView is visible if you expand one of the outer groups. I can however by setting the height of the outer groups container manually make it big enough to show all items in the inner ExpandableListView. To be optimal, calculation of height should of course be done on the fly.

So, to get to some more solid questions:

  • Can someone give me an explanation of the ExpandableListView “lifecycle” (by this I mean instantation, re-use of views, expand/collapse listeners) including:
    • How and when is an ExpandableListView notified that a child is expanded/collapsed?
    • How does the ExpandableListView know how much space to make for all children to fit into a group container?
  • How much benefit is there in using the ExpandableListView to create the above, compared to just mixing together my own solution using some LinearLayouts and some OnClickListeners?

Edit

For my last question I might note that there can be anywhere from 1 to 20+ MainGroups.

  • 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-05-27T04:58:11+00:00Added an answer on May 27, 2026 at 4:58 am

    First of all, let me recommend you GrepCode site. It has sources of Android SDK classes. Thanks for them, I’ve found out base principles of AdapterViews (I gave you a link to ExpandableListView, but it’s better if you research not only it, but its class-parents as well).

    Now, your questions and my answers:

    How and when is an ExpandableListView notified that a child is
    expanded/collapsed?

    See method handleItemClick(View v, int position, long id)

    How does the ExpandableListView know how much space to make for all
    children to fit into a group container?

    I didn’t research this question well, but as far as I know, it’s made by the method requestLayout(). Also we found out that one scrollable View cannot be embedded into another scrollable View. (It’s wide-known mistake: to put ListView into ScrollView or ListView into ExpandableListView).

    How much benefit is there in using the ExpandableListView to create
    the above, compared to just mixing together my own solution using some
    LinearLayouts and some OnClickListeners?

    AdapterViews are faster. But your construction is too complex even for ExpandableListView. You may use 2 solutions.

    1. Guru-solution: if you’re professional of designing your own
      Views/ViewGroups from the scratch (I mean, you understand methods
      requestLayout(), dispatchDraw() and so on), then write your own
      GrandExpandableListAdapter with 3 levels.
    2. Medium-solution: use ExpandableListAdapter for first 2 levels and use LinearLayouts for
      3rd level.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I am currently running into a problem where an element is coming back from
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I have some data like this: 1 2 3 4 5 9 2 6

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.