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
already attached to an AdapterView.

You can modify the ArrayList directly from a background thread (not
via the ArrayAdapter), then call notifyDataSetChanged() on the main
application thread when that work is done.

--
Mark Murphy (a Commons Guy)
http://commonsware.com | http://github.com/commonsguy
http://commonsware.com/blog | http://twitter.com/commonsguy

Localized Android Question-and-Answer Sites: http://www.andglobe.com

-- 
-- 
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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Reply via email to