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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T00:10:34+00:00 2026-06-17T00:10:34+00:00

I have a ListView in a dialog and an EditText to filter my list

  • 0

I have a ListView in a dialog and an EditText to filter my list for CustomerCodes,i’ve implemented my filter query with a TextWatcher and in onTextChanged() i’ve changed my old Cursor with

Cursor FilteredCPCodeList = CustomerDBAdapter.instance.CursorFilteredCPCode(s.toString());  //Retrieve Filtered CustomerCodeList
CpListadapter.changeCursor(FilteredCPCodeList);

List Filtering works Perfect with codes above but when i click on a ListItem it’s OnItemClickListener which use old Cursor cause an Exception which tells :

01-05 10:33:01.577: E/AndroidRuntime(5380): android.database.StaleDataException: Attempting to access a closed CursorWindow.Most probable cause: cursor is deactivated prior to calling this method.

i know that change cursor will close my old cursor but i don’t know how can i use StopManagingCursor on my old cursor(or another soloution) to solve this Issue.i’ve tried this code on onTextChanged() but it doesn’t work either

Cursor OldCursor = CpListadapter.getCursor();
stopManagingCursor(OldCursor );

any help would be appreciated,Thanks

  • 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-06-17T00:10:35+00:00Added an answer on June 17, 2026 at 12:10 am

    stopManagingCursor() is deprecated and not recommended anymore. You should be using CursorLoader. Then you can use a SimpleCursorAdapter along with the swapCursor(Cursor) method.

    If you need to use your current setup, you should be able to do CpListadapter.getCursor().close() (for example, in your onDestroy()).

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

Sidebar

Related Questions

I have a DialogFragment that creates a listview dialog and on a list item
I have a small custom dialog in wich I have a ListView with id:list.
I have a simple list view with some check boxes in an alert dialog.
I have a listview created as a resource and loaded on a dialog window.
I have a custom dialog with the format of Header + listview + footer.
I have a list view inside a dialog fragment. The list view works fine
I have a custom dialog view having a list view in its content. I
I have a listview which is filled with data form sqlitedatabase. A list-view element
I have a Jquery dialog with an ASP listview control inside. Before showing the
I have a dialog with a listView and OK button, id text radiobutton1 radiobutton2

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.