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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T06:18:41+00:00 2026-05-14T06:18:41+00:00

Pretty simple. What is the difference among those three? I want to list every

  • 0

Pretty simple.
What is the difference among those three?

I want to list every Image in a device.
Should I use managedQuery(), android.provider.MediaStore.Images.Media.query() or context.getContentResolver.query()

  • 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-14T06:18:41+00:00Added an answer on May 14, 2026 at 6:18 am

    managedQuery() will use ContentResolver’s query(). The difference is
    that with managedQuery() the activity will keep a reference to your
    Cursor and close it whenever needed (in onDestroy() for instance.) If
    you do query() yourself, you will have to manage the Cursor as a
    sensitive resource. If you forget, for instance, to close() it in
    onDestroy(), you will leak underlying resources (logcat will warn you
    about it.)

    To query a content provider, you can use either the ContentResolver.query() method or the Activity.managedQuery() method. Both methods take the same set of arguments, and both return a Cursor object. However, managedQuery() causes the activity to manage the life cycle of the Cursor. A managed Cursor handles all of the niceties, such as unloading itself when the activity pauses, and requerying itself when the activity restarts. You can ask an Activity to begin managing an unmanaged Cursor object for you by calling Activity.startManagingCursor().

    Update:

    managedQuery is now deprecated (as of Android 3.0).

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

Sidebar

Related Questions

Should be pretty simple: I have an InputStream where I want to peek at
Pretty simple question: what's the performance difference between a Byte Stream and a Character
This might be a pretty simple question, but if there really is a difference,
So this should be pretty simple, but it isn't working. I have the following
Pretty simple scenario. I have a web service that receives a byte array that
Pretty simple question: When i have a persistable object, it usually has a property
Pretty simple question, I'm writing an XML document and i'm not sure how to
Pretty simple question. I have a few ASP RequiredFieldValdators checking some text boxes. Out
Pretty simple question. I've got some Polygons and GroundOverlays defined in KML. Is there
This is pretty simple, I come from a swing/awt background. I'm just wondering what

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.