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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:48:35+00:00 2026-05-16T01:48:35+00:00

I supply a cursor to a ListActivity like this: My question is how/when should

  • 0

I supply a cursor to a ListActivity like this: My question is how/when should I close my cursor when I am done?

Cursor cursor = getContentResolver().query(uri, null, null, null, null);
        if (cursor != null) {
            mCursorAdapter = new CursorAdapter(this, cursor);
            setListAdapter(mCursorAdapter);
        }

Thank you.

  • 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-16T01:48:36+00:00Added an answer on May 16, 2026 at 1:48 am

    onDestroy(). Sooner, if you are specifically clearing out the list sooner than that. Or, call startManagingCursor(cursor), and Android will close it for you, when it is safe to do so.

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

Sidebar

Related Questions

So i have this code which should supply me with the id of a
I tried this question before and did not supply enough information, so here are
I'd like to supply instance of logged User (or null if nobody logged yet)
I want to supply an output parameter to my stored proc. This output proc
I want to supply a SQL statement from the query string, but all my
I need to supply a keyword like blue metal kettle (with/without quotes) and get
I need to supply a URL as an argument in javascript. This is needed
I would like to supply my regular expression with a 'default' value, so if
I would like to create a SP or UDF where I supply a table
I have an interfaces for my data tier that supply common methods like insert,

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.