开发者

compiler error: "Cursor cannot be resolved to a type"

开发者 https://www.devze.com 2023-01-21 18:43 出处:网络
I\'m messing around with the Notepad exercise 1. When I creat开发者_JAVA百科e the fillData method, I get an error that \"Cursor cannot be resolved to a type\"

I'm messing around with the Notepad exercise 1. When I creat开发者_JAVA百科e the fillData method, I get an error that "Cursor cannot be resolved to a type"

Here's my code:

private void fillData() {
    //get notes from DB and create item list
    Cursor c = mDbHelper.fetchAllNotes();
    startManagingCursor(c);

    String[] from = new String [] { NotesDbAdapter.KEY_TITLE };
    int[] to = new int[] { R.id.text1 };

    SimpleCursorAdapter notes = 
        new SimpleCursorAdapter(this, R.layout.notes_row, c, from, to);
    setListAdapter(notes);
}

Do I need to import the cursor class at the top of my java file? If so, how?


Most likely you need to add an import declaration

Like:

import android.database.Cursor;
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号