Directly modifying an adapter's data (especially changing the number of
items) from a background thread is a recipe for disaster.
The data can be loaded on a thread, but should be switched in the adapter
on the UI thread, followed by a call to notifyDatasetChanged, also on the
UI thread.
-- K
On Sun, Jan 27, 2013 at 7:36 PM, dashman erjdri...@gmail.com wrote:
You can modify the ArrayList directly from a background thread.
How can i do that - i don't see any api for this.
java.util.ArrayList has been around for, what, 15 years? Yes, it has
an API to allow the list to be modified.
Can an ArrayAdapter (holding data for a ListView) be modified
in a background thread.
I'd like to modify the array and then call
adapter.notifyDataSetChangedhttp://developer.android.com/reference/android/widget/ArrayAdapter.html#notifyDataSetChanged%28%29
()
--
--
You received this
On Sun, Jan 27, 2013 at 5:26 PM, dashman erjdri...@gmail.com wrote:
Can an ArrayAdapter (holding data for a ListView) be modified
in a background thread.
I'd like to modify the array and then call
On Sun, Jan 27, 2013 at 6:26 PM, dashman erjdri...@gmail.com wrote:
Can an ArrayAdapter (holding data for a ListView) be modified
in a background thread.
I'd like to modify the array and then call
adapter.notifyDataSetChanged()
You cannot modify the *adapter* in a background thread if it is
mark,
You can modify the ArrayList directly from a background thread.
How can i do that - i don't see any api for this.
--
--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to
nevermind - i decided to subl-class BaseAdapter
Thanks.
On Sunday, January 27, 2013 7:36:06 PM UTC-5, dashman wrote:
mark,
You can modify the ArrayList directly from a background thread.
How can i do that - i don't see any api for this.
--
--
You received this message because you
7 matches
Mail list logo