情況R.id.buttonTest:{光標和查詢
String[] projection = {DbTest.NAME};
String selection = "_id = ?";
String[] selectionArgs = { String.valueOf(1) };
Cursor c = sqdb.query(DbTest.TABLE_NAME,projection,selection,selectionArgs ,null,null,null);
String name = c.getString(c.getColumnIndex(DbTest.NAME));
textView1.setText(name);
}
break;
logcat的:
所致:android.database.CursorIndexOutOfBoundsException:索引-1請求,其尺寸爲1
有什麼問題?我不明白。
非常感謝你的幫助。 – user2829018