我想检查我的表是否有记录。这是我尝试过的方法:
Logcat 信息如下:
if( cursor != null ){
cursor.moveToFirst();
if (cursor.getInt(0) == 0) {
Toast.makeText(getBaseContext(), "No records yet!", Toast.LENGTH_SHORT).show();
}
}
Logcat 信息如下:
CursorIndexOutOfBoundsException: Index 0 requested, with a size of 0
非常感谢您的帮助。谢谢。