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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T22:52:07+00:00 2026-05-22T22:52:07+00:00

I want to ask a general question about the proper way to handle a

  • 0

I want to ask a general question about the proper way to handle a list with a hierarchy. The way I am doing it now is by calling the same activity with a bundle to handle the next query so I can drill down into the list. I am wondering if there is a better way to deal with lists like mine. Should I use multiple activities? (don’t know the depth of the list) or just requery my data when a user selects a list item. The problem with this solution is remembering the list item that was selected and the back button on the phone. I am sure I am missing something obvious but I’m new to Android. Any help or suggestions would be greatly appreciated. So here is what I do now:

  1. Query the data and display the list in MainActivity with with the root items.
  2. User clicks on one of the items, get the index of that item and call MainActivity with a bundle that contains the index of the item selected.
  3. Query the data with the new item and display the new list in MainActivity.
  4. rinse and repeat…

Also my list is more then two levels deep so I thing the ExpandableListView is out.

  • 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-22T22:52:07+00:00Added an answer on May 22, 2026 at 10:52 pm

    One of the reasons why ExpandableListView supports only two levels of in depth, is because its very hard to make n-level tree to be user-friendly. Just imagine the mass on user’s screen if he or she goes to 5th level.

    But, nevertheless, here is the approach I would take. I haven’t implemented it yet, but this should be doable.

    1. Introduce “Navigation Bar” at the top (like Windows Explorer has, or some sites have):

      Root > item 1 > subitem 2 > …

    2. Use `Expandable list to show current level and the next level.

    3. If user clicks on the item you will invalidate data and re-fill ExpandbleListView with next levels.

    Her is an example:

    > Root 
    ---------------
    Item 1
       Subitem 1
       Subitem 2
       Subitem 3
    Item 2 
       Subitem 4
       Subitem 5
    Item 3
       Subitem 6
    

    User clicks on Subitem 4 and sees:

    > Root > Item 2
    ---------------
    Subitem 4
       SubSubItem 1
       SubSubItem 2
       SubSubItem 3
    Subitem 5
       SubSubItem 4
       SubSubItem 5
    

    This is not trivial to implement, but shouldn’t be too hard. This gives navigation inside one Activity and uses highly optimized ExpandableListView control. You only need to implement custom adapter.

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

Sidebar

Related Questions

I want to ask an general question about the objective C. When I write
Edit: There was some confusion, but I want to ask a general question about
I want to ask a question about UITableViewCell. Apparently, this is what I want
I've just asked question about Task but realized that I actually want to ask
I want to ask about an edge-case scenario that I understand is very poor
Hi want to ask if there is a way to do this without foreach
I have a general JavaScript question. I'll give you my scenario and then ask
I'm starting to study GWT now, and have a very general question, I could
It's not specifically a ruby problem: more of a general question about algorithms. But
My particular, specific issue is probably too localized, but the general question I'm about

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.