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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T23:28:07+00:00 2026-05-26T23:28:07+00:00

I am retrieving a list of database records and displaying them using a ListView.

  • 0

I am retrieving a list of database records and displaying them using a ListView. In my bindView method in my SimpleCursorAdapter i manipulate the data to display to my requirements. This works fine.

I however want to add the data retrieved to a list, so thought I could do that in each bindView method call and store on a private variable in the Activity. What subsequently happens is that my list grows to 21 items in size whereas there are only 7 results displayed in the layout.

Why does this happen? If i add a breakpoint, I can see it’s hitting the method 21 times.. Its definitely is a multiple of 3 thing too, as if i have 8 items in my cursor, I end up with 24 in my list.

  • 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-26T23:28:08+00:00Added an answer on May 26, 2026 at 11:28 pm

    I don’t think you should be using the data retrieved for your list view to populate a local variable. It would make more sense to just pull this data back and populate the var in a separate call. The ListView operation is complicated and you are best to stick with the standard ways of using it. This is worth watching.

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

Sidebar

Related Questions

Iam retrieving data from the database and displaying it as a list, in the
I am using a custom Adapter class. And retrieving data from database using cursor.
I am retrieving a list of files from a web service and displaying them
Using the following code, I'm retrieving a list of Integers from a DB and
Having a problem retrieving a list of items from the database. This is what
Using PHP I am retrieving a list of videos. I am using jquery to
I am retrieving a lot of information in a list, linked to a database
I am retrieving the database list by executing the sp_databases stored proc. Is there
I am connecting to CRM with the intention of retrieving a list of picklist
I'm retrieving an IEnumerable list of properties via following code: BindingFlags bindingFlag = BindingFlags.Instance

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.