Reputation: 6815
I understand that Android applications have a single UI thread.
Does the runtime enforce that all UI calls are made from this thread, or is it up to the programmer to make sure no UI calls are made from other threads?
Upvotes: 0
Views: 207
Reputation: 93173
You need to do every operation with UI widgets in the UI thread. To do so you can use different approaches. I will list a few articles for you to read:
Upvotes: 0
Reputation: 1052
You cannot operate on UI items when not on UI thread. For example, you cannot change the text of a textView from a non-UI thread. You are responsible to make sure you are on UI thread when working with UI items.
Upvotes: 0
Reputation: 3319
If you try to touch a view from another thread other than the owning UI thread you will get a nice CalledFromWrongThreadException.
JAL
Upvotes: 5