jax wrote:
> I had an adapter that was no updating properly when I called
> 
> myAdapter.notifyDataSetChanged()
> 
> This causes much headache an finally I tried
> 
> cursor.requery(); //This is the cursor on which myAdapter is connected
> to
> myAdapter.notifyDataSetChanged();
> 
> 
> My Question is - Why do I need to run requery()? I thought that
> notifyDataSetChanged() would automatically update the cursor for us!

notifyDataSetChanged() tells those monitoring the adapter that the
adapter changed. If you manually call that yourself, you must manually
update the adapter first.

In the case of a CursorAdapter, simply calling requery() on the Cursor
will automatically trigger notifyDataSetChanged() on the CursorAdapter,
so you do not need your second statement.

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com | http://twitter.com/commonsguy

Android Training in Germany, 18-22 January 2010: http://bignerdranch.com

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to