如何从CursorAdapter中刷新ListView?

and*_*ndi 2 android listview android-cursoradapter

我的Activity中有一个ListView,它在onCreateby中设置

    MyCursorAdapter adapter = new TaskConditsCursorAdapter(this, conditsCursor, taskID, isNewTask);
    setListAdapter(adapter);
Run Code Online (Sandbox Code Playgroud)

然后我做了一些工作MyCursorAdapter.除此之外,我有一个行特定的AlertDialog:

...
    builder.setPositiveButton("OK"), new DialogInterface.OnClickListener() {
        public void onClick(DialogInterface dialog, int item) {
            changeTaskConditBoolValue(taskId, conditId, chosenBoolValue2);
            // refresh?
        }
    });
Run Code Online (Sandbox Code Playgroud)

之后changeTaskConditBoolValue我想重新加载我的List,因为这个方法在数据库中改变了一些东西,但List没有更新.requery()结果列表为空.我怎样才能"再高一级" adapter再次与我合作,那么我该怎么做呢?

非常感谢!

and*_*ndi 6

MyCursorAdapter-the调用的方法中onClick- 在我的情况下,changeTaskConditBoolValue(...)我必须调用:

this.changeCursor(db.fetchAllTasks(myParameters));
Run Code Online (Sandbox Code Playgroud)

这将由我的Database-Class获取一个新游标,并用新的游标替换它自己的旧游标.

找不到其他方法从CursorAdapter内部更改光标.