ok thanks
On Oct 17, 6:58 pm, Mark Murphy <mmur...@commonsware.com> wrote:
> 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 android-beginners@googlegroups.com
To unsubscribe from this group, send email to
android-beginners+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---