Code example for Cursor

Methods: closedeactivategetCountgetStringmoveToFirstrequery

0
        populateDefaultTable(); 
 
        Cursor c = mDatabase.rawQuery("SELECT data FROM test WHERE data = '" + sString1 + "'",
                null); 
        assertNotNull(c);
        assertEquals(1, c.getCount());
        assertTrue(c.moveToFirst());
        assertEquals(sString1, c.getString(0));
        c.deactivate();
        c.requery();
        assertEquals(1, c.getCount());
        assertTrue(c.moveToFirst());
        assertEquals(sString1, c.getString(0));
        c.close();
    } 
 
    @MediumTest 
    public void testRequeryWithSelectionArgs() throws Exception { 
        populateDefaultTable(); 
 
        Cursor c = mDatabase.rawQuery("SELECT data FROM test WHERE data = ?",