Hi guys,
The following function is giving me an out of bounds exception...
public void count(){
SQLiteDatabase db = table.getWritableDatabase();
String count = "SELECT count(*) FROM table";
Cursor mcursor = db.rawQuery(count, null);
int icount = mcursor.getInt(0);
System.out.println("NUMBER IN DB: " + icount);
}
It's meant to return the number of rows in the database. Anybody know whats wrong? am I perhaps doing this task the wrong way?