Hi,

Loading the data from a background thread is a very good idea.
However, adding the data to the adapter MUST be done on the UI thread.
All you have to do is create a Handler to post the results back in the
UI thread. If you don't want to create a Handler and you have a
reference to your Activity or to a View you can use either
Activity.runOnUiThread() or View.post(Runnable).

On Sat, Nov 8, 2008 at 12:09 PM, Emery <[EMAIL PROTECTED]> wrote:
>
> I posted this before but never got an answer. I have data coming in on
> a separate thread and I want to add the items to a ListView
> asynchronously as the items are received (I do not want to block the
> UI thread). If I try to add the items from the other thread I get a
> CalledFromWrongThreadException "Only the original thread that created
> a view hierarchy can touch its views.".
>
> How can I do this? Thanks!
> >
>



-- 
Romain Guy
www.curious-creature.org

--~--~---------~--~----~------------~-------~--~----~
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
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to