Calling notifyDataSetChanged doesn't fire onContentChanged event of SimpleCursorAdapter
Posted
by Pentium10
on Stack Overflow
See other posts from Stack Overflow
or by Pentium10
Published on 2010-05-18T10:26:08Z
Indexed on
2010/05/18
10:30 UTC
Read the original article
Hit count: 819
I have this scenario
onResume of an activity:
@Override
protected void onResume() {
if (adapter1!=null) adapter1.notifyDataSetChanged();
if (adapter2!=null) adapter2.notifyDataSetChanged();
if (adapter3!=null) adapter3.notifyDataSetChanged();
super.onResume();
}
Adapter has been defined as:
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();
}
}
And the onContentChanged event is not fired, although the onResume and the call to the adapter is issued. What is wrong?
© Stack Overflow or respective owner