Hi,

Views can only be accessed from the main thread, also called UI
thread. Please refer to the documentation of the Handler class, or of
the methods Activity.runOnUiThread() and View.post().

On Sun, Jan 18, 2009 at 12:43 PM, JD <[email protected]> wrote:
>
> Hi,
>
>  I got this exception (CallFromWrongThread) raised from ViewRoot when
> executing the android emulator.
>  What I'm doing is that I'm accessing a ViewText this way:
>
>  String s = "something interesting";
>  TextView msgTextView = (TextView) findViewById(R.id.label);
>  msgTextView.setText(s);   // the exception is raised here
>
>  This code is in the 'run' function of a Thread object called in the
> onCreate main function.
>  I can't find any documentation on this exception and even though the
> name is quite explicit, I don't get how a thread can be wrong when
> accessing a View object.
>
>  Thanks for your help.
>
> >
>



-- 
Romain Guy
Android framework engineer
[email protected]

Note: please don't send private questions to me, as I don't have time
to provide private support.  All such questions should be posted on
public forums, where I and others can see and answer them

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to [email protected]
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