Code example for CursorWindow

0
public class MemoryCursor extends AbstractWindowedCursor {
 
    private final String[] mColumnNames;
 
    public MemoryCursor(String name, String[] columnNames) {
        setWindow(new CursorWindow(name));
        mColumnNames = columnNames;
    } 
 
    public void fillFromCursor(Cursor cursor) {
        DatabaseUtils.cursorFillWindow(cursor, 0, getWindow());
    } 
 
    @Override 
    public int getCount() { 
        return getWindow().getNumRows();
    } 
 
    @Override 
    public String[] getColumnNames() {
        return mColumnNames;