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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T05:53:00+00:00 2026-05-28T05:53:00+00:00

I have to implement something like that: ListViews I call month.setadapter(adapter) once for each

  • 0

I have to implement something like that:
enter image description here
“ListViews”

I call month.setadapter(adapter) once for each year but it’s not working because the last month overwrites the information of the previous last one.

Please help me regarding this.

  • 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-28T05:53:00+00:00Added an answer on May 28, 2026 at 5:53 am

    What I normally do in a situation like this is implement it as a single custom adapter.

    1. Derive from BaseAdapter
    2. Set your data as a non-generic ArrayList. You can fill your ArrayList with data representing your month rows and the detail rows within each month. You need some way of differentiating them in the adapter, so wrap things in custom objects that allow you to do this. In your example above, I’d say you can iterate through your data and insert a Date object each time you reach a row with a different month than the previous data row.
    3. Your adapter should override getItemViewType and getItemViewCount. getItemViewCount returns the total number of different view types (looks like you’ll return 2 from this method).
    4. In getView, take the position parameter and pass it to getItemViewType. In getItemViewType, get the item in your ArrayList at the current position and test it for its data type. Return a constant representing which type of data to display.
    5. In getView, now that you have the data type to display, run code appropriate for this display – inflate the layout representing the appropriate row type and set the appropriate data on the child views of the layout.

    All of this is covered in the “World of ListView” video from Google I/O 2010 that ALL Android programmers should watch at least once:

    http://www.youtube.com/watch?v=wDBM6wVEO70

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

Sidebar

Related Questions

Let's say I have a class that implements the IDisposable interface. Something like this:
I want to implement something like voip communication that client doesn't need to install
I'm to make a web app that will implement something like user hierarchy. I
I'm searching for a way to implement something like reusable cells for UI/NSTableView but
I want to implement something like facebook's unread items/notifications. I have the following model
I have implement something like the following on J2me. Is it possible to implement
Suppose I have a table view, and I want to implement something like this:
I'm working on a thread library which implement user level threads (i have something
I am looking to implement a continuous unit test running system, something I have
I have a class Something that implements ISomething . How can I convert/cast from

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.