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.)

On Thu, Feb 5, 2009 at 1:32 PM, Meryl Silverburgh
<silverburgh.me...@gmail.com> wrote:
>
> I have read:
> http://code.google.com/android/devel/data/contentproviders.html
>
> But I don't understand what is the difference between managedQuery()
> and getContentREsolver().query()?
> Seems to me both take a Uri and query parameters and then return a Cursor.
>
> I appreciate if anyone can tell me the difference.
>
> Thank you.
>
> >
>



-- 
Romain Guy
Android framework engineer
romain...@android.com

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to