It depends on how android treats onClick events.
According to the behavior seen in his example it seems like that android 
doesn't check whether a view is disabled before running onClick rather 
before queuing it.

So if you manage to dispatch two onClick events to a view before the first 
one was processed (and disabling itself), both will sit in the queue and 
both will be run.



On Tuesday, October 16, 2012 4:30:22 PM UTC+2, Greenhand wrote:
>
> I think I am confused.
> If the entire Android UI is completely thread safe and the events are 
> queued, the event should be processed one by one. I would like to know why 
> an inconsistent state can be seen during the execution even if I do not 
> start a new thread in my code.
>
> G. Blake Meike於 2012年10月15日星期一UTC+8下午8時05分39秒寫道:
>
>> 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+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to