The following statement cursor.moveToNext()
is always false. I expect the loop to execute once. I've tested that the query actually returns data.
Does anyone know what is the matter?
String query ="SELECT(SELECT COUNT(*) FROM Table1) as count1, (SELECT COUNT(*) FROM Table2) as count2;";
Cursor mCursor = mDb.rawQuery(query, null);
if (mCursor != null) {
mCursor.moveToFirst();
}
while (cursor.moveToNext()) { //<---------------return false here???
String result_0=cursor.getString(0);
}