Android SimpleCursorAdapter No such column Id

后端 未结 4 535
囚心锁ツ
囚心锁ツ 2021-01-20 18:31

I have a Listview that I want to populate with information from my SQLite database with and this seemed like the most practical solution. In my debugger it says it\'s caused

4条回答
  •  被撕碎了的回忆
    2021-01-20 19:07

    You are not including _id in your column list for the query you do in getSpinnerData().

    FYI,

    You must be extending CursorAdapter which demand _id column.

    _id is used only in CursorAdapter to determine which column is id. You can override this behavior in CursorAdapter or add alias in query to id.

提交回复
热议问题