Re: [android-developers] ArrayAdapter in background thread

2013-01-28 Thread Kostya Vasilyev
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

Re: [android-developers] ArrayAdapter in background thread

2013-01-28 Thread Mark Murphy
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.

[android-developers] ArrayAdapter in background thread

2013-01-27 Thread dashman
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

Re: [android-developers] ArrayAdapter in background thread

2013-01-27 Thread TreKing
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

Re: [android-developers] ArrayAdapter in background thread

2013-01-27 Thread Mark Murphy
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

Re: [android-developers] ArrayAdapter in background thread

2013-01-27 Thread dashman
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

Re: [android-developers] ArrayAdapter in background thread

2013-01-27 Thread dashman
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