Android.App.Activity.ManagedQuery Method
Wrapper around Android.Content.ContentResolver.Query(Android.Net.Uri, System.String[], System.String[], System.String[], System.String[]) that gives the resulting Android.Database.ICursor to call Activity.StartManagingCursor(Android.Database.ICursor) so that the activity will manage its lifecycle for you.

Syntax

[Android.Runtime.Register("managedQuery", "(Landroid/net/Uri;[Ljava/lang/String;Ljava/lang/String;[Ljava/lang/String;Ljava/lang/String;)Landroid/database/Cursor;", "")]
[System.Obsolete("deprecated")]
public Android.Database.ICursor ManagedQuery (Android.Net.Uri uri, string[] projection, string selection, string[] selectionArgs, string sortOrder)

See Also

Android.Content.ContentResolver.Query(Android.Net.Uri, System.String[], System.String[], System.String[], System.String[])
Activity.StartManagingCursor(Android.Database.ICursor)

Parameters

uri
The URI of the content provider to query.
projection
List of columns to return.
selection
SQL WHERE clause.
selectionArgs
The arguments to selection, if any ?s are pesent
sortOrder
SQL ORDER BY clause.

Returns

Documentation for this section has not yet been entered.

Remarks

Wrapper around Android.Content.ContentResolver.Query(Android.Net.Uri, System.String[], System.String[], System.String[], System.String[]) that gives the resulting Android.Database.ICursor to call Activity.StartManagingCursor(Android.Database.ICursor) so that the activity will manage its lifecycle for you. If you are targeting NoType:android/os/Build$VERSION_CODES;Href=../../../reference/android/os/Build.VERSION_CODES.html#HONEYCOMB or later, consider instead using Android.App.LoaderManager instead, available via Activity.LoaderManager.

Warning: Do not call Android.Database.ICursor.Close on a cursor obtained using this method, because the activity will do that for you at the appropriate time. However, if you call Activity.StopManagingCursor(Android.Database.ICursor) on a cursor from a managed query, the system will not automatically close the cursor and, in that case, you must call Android.Database.ICursor.Close.

[Android Documentation]

Requirements

Namespace: Android.App
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 1