Monday, October 15, 2012

[android-developers] Re: Button#onClickListener thread unsafe?

Lew is exactly correct.  The entire Android UI is completely thread safe, because it runs on a single thread.  During execution of your program, you may, from within the code, be able to see a state that is inconsistent.  That is only because you are observing that state from a partially processed event.  Each new even will observe consistent state.

... but the main point is that you don't need to worry: unless you explicitly start a new thread, looper or asynctask, everything in the UI is on a single thread.  It is safe.

G. Blake Meike
Marakana

The second edition of Programming Android is now on-line:
http://shop.oreilly.com/product/0636920023005.do

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

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate