顯示具有 SQLite 標籤的文章。 顯示所有文章
顯示具有 SQLite 標籤的文章。 顯示所有文章

2010年11月14日 星期日

【Android】simplecursoradapter column '_id' does not exist

錯誤
在建構 SimpleCursorAdapter 時 try catch出
column '_id' does not exist
的錯誤訊息。
try{
    SimpleCursorAdapter adapter =
        new SimpleCursorAdapter(this, android.R.layout.simple_list_item_1, 
        mNotesCursor, from, to);
    setListAdapter(adapter); 
}catch(Exception ex){
    Log.e("Note class", "error: " + ex.getMessage(), ex);
}