Java 编译器错误:";无法将游标解析为类型";

Java 编译器错误:";无法将游标解析为类型";,java,android,Java,Android,我在玩记事本练习1。当我创建fillData方法时,我得到一个错误“游标无法解析为类型” 这是我的密码: private void fillData() { //get notes from DB and create item list Cursor c = mDbHelper.fetchAllNotes(); startManagingCursor(c); String[] from = new String [] { NotesDbAdapter.KEY_

我在玩记事本练习1。当我创建fillData方法时,我得到一个错误“游标无法解析为类型”

这是我的密码:

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);
}

我需要导入java文件顶部的游标类吗?如果是,怎么做?

您最有可能需要添加
导入
声明

比如:

import android.database.Cursor;

@xscott导入实际上是一个声明(我还以为它也是一个声明)@falmari是的,我正在使用eclipse。你应该在
光标c
下看到一条小红线,上下文菜单会告诉你该怎么做。谢谢。我只是让eclipse来做这项工作。右键单击错误并让它导入正确的类;显然,如果使用eclipse,只需按Ctrl+Shift+O即可导入所有必要的包。