相关疑难解决方法(0)

IllegalArgumentException:调用SimpleCursorAdaptor时,列'_id'不存在

我有一个表命名为"大师"的柱子id,name,surname,gender,和 designation

当我触发查询以获取CursorAdapterCursor对象时,我得到:

IllegalArgumentException: column '_id' does not exist when call to CursorAdaptor 
Run Code Online (Sandbox Code Playgroud)

但我没有名为"_id"的columen.

谁能告诉我为什么会收到这个错误?

这是堆栈跟踪:

07-13 15:45:40.582: WARN/System.err(295): java.lang.IllegalArgumentException: column '_id' does not exist
07-13 15:45:40.592: WARN/System.err(295):     at android.database.AbstractCursor.getColumnIndexOrThrow(AbstractCursor.java:314)
07-13 15:45:40.592: WARN/System.err(295):     at android.widget.CursorAdapter.changeCursor(CursorAdapter.java:257)
07-13 15:45:40.602: WARN/System.err(295):     at com.praumtech.names4baby.ui.NamesListAdapter.setCursor(NamesListAdapter.java:63)
07-13 15:45:40.602: WARN/System.err(295):     at com.praumtech.names4baby.ui.BoysNamesListActivity.initNameList(BoysNamesListActivity.java:79)
07-13 15:45:40.602: WARN/System.err(295):     at com.praumtech.names4baby.ui.BoysNamesListActivity.onCreate(BoysNamesListActivity.java:49)
07-13 15:45:40.602: WARN/System.err(295):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1123)
07-13 15:45:40.602: WARN/System.err(295):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2364)
07-13 15:45:40.612: WARN/System.err(295):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2417)
07-13 15:45:40.612: WARN/System.err(295): …
Run Code Online (Sandbox Code Playgroud)

database android

9
推荐指数
1
解决办法
7593
查看次数

标签 统计

android ×1

database ×1