Share via


CursorAdapter.SwapCursor(ICursor) Method

Definition

Swap in a new Cursor, returning the old Cursor.

[Android.Runtime.Register("swapCursor", "(Landroid/database/Cursor;)Landroid/database/Cursor;", "GetSwapCursor_Landroid_database_Cursor_Handler")]
public virtual Android.Database.ICursor? SwapCursor (Android.Database.ICursor? newCursor);
[<Android.Runtime.Register("swapCursor", "(Landroid/database/Cursor;)Landroid/database/Cursor;", "GetSwapCursor_Landroid_database_Cursor_Handler")>]
abstract member SwapCursor : Android.Database.ICursor -> Android.Database.ICursor
override this.SwapCursor : Android.Database.ICursor -> Android.Database.ICursor

Parameters

newCursor
ICursor

The new cursor to be used.

Returns

Returns the previously set Cursor, or null if there was not one. If the given new Cursor is the same instance is the previously set Cursor, null is also returned.

Attributes

Remarks

Swap in a new Cursor, returning the old Cursor. Unlike #changeCursor(Cursor), the returned old Cursor is <em>not</em> closed.

Java documentation for android.widget.CursorAdapter.swapCursor(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