Friday, July 2, 2010

Re: [android-developers] Re: CursorAdapter notifyDataSetChanged doesn't work? What am I doing wrong?

I think for getting this callback, you need to call setNotifyOnChange(true).

On 7/2/10, Mark Murphy <mmurphy@commonsware.com> wrote:
> On Thu, Jul 1, 2010 at 10:51 PM, Moto <medicalsounds@gmail.com> wrote:
>> But not sure if design wise is good? Why doesn't
>> notifyDataSetChanged() work? what's the difference on what I just did?
>
> requery() reloads the Cursor's data.
>
> notifyDataSetChanged() tells an Adapter's listeners that its data has
> changed.
>
> requery() on a Cursor will cause an attached CursorAdapter to call
> notifyDataSetChanged(), after having loaded in the new data.
>
> Calling notifyDataSetChanged() yourself, without actually having
> changed the data set, will not work.
>
> --
> Mark Murphy (a Commons Guy)
> http://commonsware.com | http://github.com/commonsguy
> http://commonsware.com/blog | http://twitter.com/commonsguy
>
> Android Training...At Your Office: http://commonsware.com/training
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscribe@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en

--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate