Use cursor.moveToFirst instead of moveToNext for safety.