我试图database
在Spinner
. SimpleCursorAdapter
有些人怎么做不到
Cursor cs=db.getAllSession();
String[] from=new String[]{"sess_name"};
int[] to=new int[]{android.R.id.text1};
SimpleCursorAdapter adapter= new SimpleCursorAdapter(this, android.R.layout.simple_spinner_item, cs, from, to );
adapter.setDropDownViewResource( android.R.layout.simple_spinner_dropdown_item );
sp.setAdapter(adapter);
会话表有两个字段id
和sess_name
. 我得到非法参数异常。
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.world.shaman/com.world.shaman.Test}: java.lang.IllegalArgumentException: column '_id' does not exist
我不知道是什么问题