How To Test If Cursor Is Empty in a SQLiteDatabase Query
The easiest and cleanest way to test for an empty cursor is the following code:
if ( cursor.moveToFirst() ) { // start activity a} else { // start activity b}
Per the docs, the method returns false if the cursor is empty:
http://developer.android.com/reference/android/database/Cursor.html#moveToFirst%28%29
public abstract boolean moveToFirst ()
Added in API level 1 Move the cursor to the first row.
This method will return false if the cursor is empty.
Returns whether the move succeeded.