Activity.StartManagingCursor(ICursor) Method

Definition

Caution

deprecated

This method allows the activity to take care of managing the given Cursor's lifecycle for you based on the activity's lifecycle.

[Android.Runtime.Register("startManagingCursor", "(Landroid/database/Cursor;)V", "GetStartManagingCursor_Landroid_database_Cursor_Handler")]
[System.Obsolete("deprecated")]
public virtual void StartManagingCursor (Android.Database.ICursor? c);
[<Android.Runtime.Register("startManagingCursor", "(Landroid/database/Cursor;)V", "GetStartManagingCursor_Landroid_database_Cursor_Handler")>]
[<System.Obsolete("deprecated")>]
abstract member StartManagingCursor : Android.Database.ICursor -> unit
override this.StartManagingCursor : Android.Database.ICursor -> unit

Parameters

c
ICursor

The Cursor to be managed.

Attributes

Remarks

This method allows the activity to take care of managing the given Cursor's lifecycle for you based on the activity's lifecycle. That is, when the activity is stopped it will automatically call Cursor#deactivate on the given Cursor, and when it is later restarted it will call Cursor#requery for you. When the activity is destroyed, all managed Cursors will be closed automatically.

<em>If you are targeting android.os.Build.VERSION_CODES#HONEYCOMB or later, consider instead using LoaderManager instead, available via #getLoaderManager().</em>

<strong>Warning:</strong> Do not call Cursor#close() on cursor obtained from #managedQuery, because the activity will do that for you at the appropriate time. However, if you call #stopManagingCursor on a cursor from a managed query, the system <em>will not</em> automatically close the cursor and, in that case, you must call Cursor#close().

This member is deprecated. Use the new android.content.CursorLoader class with LoaderManager instead; this is also available on older platforms through the Android compatibility package.

Java documentation for android.app.Activity.startManagingCursor(android.database.Cursor).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also

  • <xref:Android.App.Activity.ManagedQuery(Android.Net.Uri%2c+System.String%5b%5d%2c+System.String%5b%5d%2c+System.String%5b%5d%2c+System.String%5b%5d)>
  • StopManagingCursor(ICursor)