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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T04:08:35+00:00 2026-05-30T04:08:35+00:00

My problem: My ListView resets its scroll position to the top whenever I update

  • 0

My problem: My ListView resets its scroll position to the top whenever I update its contents through its (customized) SimpleCursorAdapter. I would like the ListView to maintain its scroll position when updated.

I started out by creating a new adapter instance every time and using ListView.setAdapter(), but according to this discussion I should be updating the adapter instead of resetting it. I can’t find a way to do this for SimpleCursorAdapter that works correctly.

Here are some things I’ve tried, omitting the method arguments:
– SimpleCursorAdapter.changeCursorAndColumns() with a fresh cursor successfully updates the adapter but still resets the scroll position.
– SimpleCursorAdapter.changeCursor() acts the same way.
– SimpleCursorAdapter.swapCursor() isn’t available until api 11, and I am developing for api 8.
– SimpleCursorAdapter.notifyDataSetChanged() does not update the ListView. (Maybe there is another step I’m missing.)
– ListView.invalidate() does not update the ListView.
– SimpleCursorAdapter.requery() makes the ListView blank, and is deprecated.
– I’m familiar with the ListView.setSelection() solution, but I don’t want my ListView to move at all when it is updated. This snaps it to a position in the list.

This seems like it should be a common and simple problem. Has anybody dealt with it?

  • 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-30T04:08:36+00:00Added an answer on May 30, 2026 at 4:08 am

    I’ve had a similar problem: My CursorAdapter reset the scroll position whenever the contents of the cursor changed.

    I didn’t realize that I actually did set a new list adapter each time the data changed. I thought the cursor himself would notify the adapter about changes to it’s content but in my case it is the ContentProvider that triggers LoaderManager.LoaderCallbacks.onLoadFinished() in my ListFragment. In that callback I now use CursorAdapter.changeCursor() instead of creating a new adapter and everything works just fine.

    I hope this helps solving your problem.

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

Sidebar

Related Questions

Hi I'm having problem refreshing my listview after Async operation. I have a simplecursoradapter,
I have problem in Listview onListItemClick() method. I am not getting the position of
I have a little problem with a Listview. I can load it with listview
Doing the below will reproduce my problem: New WPF Project Add ListView Name the
I have a problem, I am using the method in listview ListView.SelectedItems[0] to return
I have the following problem. The background color in a ListView is set LightGreen
EDIT: This problem may be related to BaseAdapter causing ListView to go out of
here's a problem that i've run into lately: I have a listview with a
I have quite a tricky problem: I am using a ListView control with the
I have a problem displaying the results of an sql query into a ListView

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.