0

私はこのシナリオを持っています

onアクティビティの再開:

@Override
    protected void onResume() {
        if (adapter1!=null) adapter1.notifyDataSetChanged();
        if (adapter2!=null) adapter2.notifyDataSetChanged();
        if (adapter3!=null) adapter3.notifyDataSetChanged();
        super.onResume();
    }

アダプターは次のように定義されています。

public class ListCursorAdapter extends SimpleCursorAdapter {

   Cursor c;
    /* (non-Javadoc)
     * @see android.widget.CursorAdapter#onContentChanged()
     */
    @Override
    protected void onContentChanged() {
        // this is not called
        if (c!=null) c.requery();
        super.onContentChanged();
    }
}

また、onResumeとアダプターの呼び出しは発行されますが、onContentChangedイベントは発生しません。なにが問題ですか?

4

1 に答える 1

1

onContentChangedメソッドは、カーソル上のContentObserverが変更通知を受信したときに呼び出されます。

于 2010-05-18T11:35:43.847 に答える