Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
android.database.CursorIndexOutOfBoundsException: 请求索引 0,大小为 0
我正在尝试从数据库中删除联系人。但我收到此错误。为什么?
尝试像这样使 ID 自动递增,这样它就可以自动递增:
String CREATE_CONTACT_TABLE = "CREATE TABLE " + Util.TABLE_NAME + "( " + Util.KEY_ID + " INTEGER PRIMARY KEY AUTOINCREMENT," + Util.KEY_NAME + " TEXT," + Util.KEY_PHONE_NUMBER + " TEXT" + ")"; db.execSQL( CREATE_CONTACT_TABLE );