Code example for Cursor

Methods: deactivategetCount

0
        populateDefaultTable(); 
        SQLiteStatement statement = mDatabase.compileStatement("DELETE FROM test");
        statement.execute();
 
        Cursor c = mDatabase.query("test", null, null, null, null, null, null);
        assertEquals(0, c.getCount());
        c.deactivate();
        statement.close();
    } 
 
    @MediumTest 
    public void testSimpleQuery() throws Exception { 
        mDatabase.execSQL("CREATE TABLE test (num INTEGER NOT NULL, str TEXT NOT NULL);");
        mDatabase.execSQL("INSERT INTO test VALUES (1234, 'hello');");
        SQLiteStatement statement1 =
                mDatabase.compileStatement("SELECT num FROM test WHERE str = ?");
        SQLiteStatement statement2 =
                mDatabase.compileStatement("SELECT str FROM test WHERE num = ?");
 
        try { 
            statement1.bindString(1, "hello");