show data in list view by cursor

守給你的承諾、 提交于 2019-12-02 11:57:02

A cursor adapter requires that the cursor you give it contains an _id column, as stated in the documentation :

The Cursor must include a column named "_id" or this class will not work.

You need to add such a column to your table. It is the id that is used in all methods that mention an id (onItemSelected, getItemId, ...)

You should include column "_id" of your selection list of columns for SimpleCursorAdapter

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!