Re: The ListViews scroll position resets back to the top after every .notifyChange()

54 views
Skip to first unread message

roee88

unread,
Sep 3, 2011, 5:39:52 PM9/3/11
to android-appwidget-extensions
Sorry for opening a new thread (google groups via web does not allow
responding to the original thread because it is too old).

I'm getting the same behavior on both v1 and v2 and couldn't find any
way to bypass it.
I can set scroll position manually but can't really know the last
scroll position.
Is there any known workaround?

If not, I think a simple change to WidgetListAdapter.java and
WidgetRemoteViewsListAdapter.java can fix it.
Just replace notifyDataSetInvalidated with notifyDataSetChanged.
Also, I think using AsyncQueryHandler instead of a Runnable for
querying data would be cleaner.

Thanks,
Roee.

>> Hi,
>> I'm using API v2 as per Florian's scrollable contacts widget. It
>> works very well except whenever my ContentProvider
>> calls .notifyChange() it resets the scroll position on the widgets
>> ListView back to 0? It still updates with the provider change but it
>> disrupts the user experience. I've seen other scrollable widgets
>> manage to update the list without disturbing it's scroll position.
>> Can someone please help?
>> Regards,
>> Steve.
Reply all
Reply to author
Forward
0 new messages