Hello all,
I got a ListActivity.
I update the activity using onContentChanged() API.
My problem is that each time I call the above API the list scrolls to the top. Is there any easy way to turn this "feature" off?
Thanks.
/ Henrik
Hello all,
I got a ListActivity.
I update the activity using onContentChanged() API.
My problem is that each time I call the above API the list scrolls to the top. Is there any easy way to turn this "feature" off?
Thanks.
/ Henrik
Activity#onContentChanged
is not for 'updating' the data for the activity. It is called when the content view of the activity changes, i.e., when Activity#setContentView
is called. The ListActivity
will reinitialize it's content view when it receives onContentChanged
.
The answer is, you're doing it wrong, don't use onContentChanged
the way you are using it. That is why you are seeing this unexpected behavior. Use another method to update the ListView
, most probably by calling notifyDataSetChanged
from your Adapter
.