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

  • Home
  • SEARCH
  • 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 4588300
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T21:54:10+00:00 2026-05-21T21:54:10+00:00

i have to make a sectioned list in my application. For this i am

  • 0

i have to make a sectioned list in my application. For this i am using the following approach:

  • make a listview to contain the headers of each sections
  • the xml inflated in the getview of each item in the above list consists of a textview and a tablelayout
  • the custom adapter used to make the views for the above listview, i fill the textview with the header and add rows into the tablelayout until all the section is filled.

Naturally i maintain two arrays: 1) for the headers 2) for the section details(actually for this i use a hashmap with the section header index in its array as the key, this is my of identifying which header belongs to which section).

for some reason the above code is not working and the data is being repeated in different sections…eg. the second section contains data of the 1st and the 2nd section combined?

why is this happening?

Doesn’t the idea mentioned above seem correct?

what is going wrong over here?

thank you in advance.

  • 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-21T21:54:11+00:00Added an answer on May 21, 2026 at 9:54 pm

    For hierarchical data structures you should rather use ExpandableListView/ExpandableListActivity then ListView (see this example for reference).

    This way you’ll use a BaseExpandableListAdapter to populate your list, which has two methods for the renderers:

    • getGroupView should be overridden
      for the headers,
    • getChildView should be overridden
      for the child items of the different
      headers

    If you don’t need your list to be collapsable/expandable, you set all of your groups expanded, and disable collapsing as described here.

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

Sidebar

Related Questions

I have to make own contact list, where i want to put section headers.
I have to make column charts in Excel using VBA only (no user input).
I have to make a schema for an XML format that's already being used.
In our application we sometimes have to make minor GUI modifications for different customers:
I'm working on an application where users have to make a call and type
I have found this example on StackOverflow: var people = new List<Person> { new
I have a list of Person s each which have multiple fields that I
I have a list view which contains a button in each row of the
I need to make a custom ListView with multiple view types. I found this
I have a control which I have to make large modifications to. I'd like

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.