Hello All,
In my android application i have created a class to handle sqlite database & table.
In that i have created one function which returns all the records in the table.
Below is the code i m using
Cursor result=null;result = db.query(DATABASE_TABLE1, new String[]{KEY_ID,KEY_UID,KEY_TICKETID},null, null, null, null, null);
return result;
inspite of records being there i m getting a empty cursor.
But if i write
System.out.println("getAllItemsCursor(), " + result.getCount());
before return result statement i m getting the records properly i.e. non-empty cursor.
Can anybody guide me where i m making a mistake.
In my android application i have created a class to handle sqlite database & table.
In that i have created one function which returns all the records in the table.
Below is the code i m using
Cursor result=null;result = db.query(DATABASE_TABLE1, new String[]{KEY_ID,KEY_UID,KEY_TICKETID},null, null, null, null, null);
return result;
inspite of records being there i m getting a empty cursor.
But if i write
System.out.println("getAllItemsCursor(), " + result.getCount());
before return result statement i m getting the records properly i.e. non-empty cursor.
Can anybody guide me where i m making a mistake.