Please note that the contents of this offline web site may be out of date. To access the most recent documentation visit the online version .
Note that links that point to online resources are green in color and will open in a new window.
We would love it if you could give us feedback about this material by filling this form (You have to be online to fill it)
Android APIs
public interface

CrossProcessCursor

implements Cursor
android.database.CrossProcessCursor
Known Indirect Subclasses

Class Overview

A cross process cursor is an extension of a Cursor that also supports usage from remote processes.

The contents of a cross process cursor are marshalled to the remote process by filling CursorWindow objects using fillWindow(int, CursorWindow) . As an optimization, the cursor can provide a pre-filled window to use via getWindow() thereby obviating the need to copy the data to yet another cursor window.

Summary

[Expand]
Inherited Constants
From interface android.database.Cursor
Public Methods
abstract void fillWindow (int position, CursorWindow window)
Copies cursor data into the window.
abstract CursorWindow getWindow ()
Returns a pre-filled window that contains the data within this cursor.
abstract boolean onMove (int oldPosition, int newPosition)
This function is called every time the cursor is successfully scrolled to a new position, giving the subclass a chance to update any state it may have.
[Expand]
Inherited Methods
From interface android.database.Cursor
From interface java.io.Closeable
From interface java.lang.AutoCloseable

Public Methods

public abstract void fillWindow (int position, CursorWindow window)

Added in API level 1

Copies cursor data into the window.

Clears the window and fills it with data beginning at the requested row position until all of the data in the cursor is exhausted or the window runs out of space.

The filled window uses the same row indices as the original cursor. For example, if you fill a window starting from row 5 from the cursor, you can query the contents of row 5 from the window just by asking it for row 5 because there is a direct correspondence between the row indices used by the cursor and the window.

The current position of the cursor, as returned by getPosition() , is not changed by this method.

Parameters
position The zero-based index of the first row to copy into the window.
window The window to fill.

public abstract CursorWindow getWindow ()

Added in API level 1

Returns a pre-filled window that contains the data within this cursor.

In particular, the window contains the row indicated by getPosition() . The window's contents are automatically scrolled whenever the current row moved outside the range covered by the window.

Returns
  • The pre-filled window, or null if none.

public abstract boolean onMove (int oldPosition, int newPosition)

Added in API level 1

This function is called every time the cursor is successfully scrolled to a new position, giving the subclass a chance to update any state it may have. If it returns false the move function will also do so and the cursor will scroll to the beforeFirst position.

This function should be called by methods such as moveToPosition(int) , so it will typically not be called from outside of the cursor class itself.

Parameters
oldPosition The position that we're moving from.
newPosition The position that we're moving to.
Returns
  • True if the move is successful, false otherwise.