Simple Cursor Adapter problem

后端 未结 3 1957
北荒
北荒 2021-01-25 08:01

Here is my code for a simple cursor adapter.

public class CursorList extends ListActivity {
/** Called when the activity is first created. */
@Override
public vo         


        
3条回答
  •  生来不讨喜
    2021-01-25 08:25

    You need to include the table _id in the projection. the list cursor adapter needs the _id to keep track of the rows. you don't have to actually display it anywhere or use it but the cursor needs to contain that column. also a primary key column named _id is mandatory in every android table.

提交回复
热议问题