The only use case I have used for calling `runOnUiThread()` is in my test 
suite when I need access to UI components after instrumenting some user 
interactions. In this case, I use the similar 
`Instrumentation.runOnMainSync()`. Since this call is synchronous, it might 
not have the same issues which you are asking about here.

On Tuesday, June 9, 2015 at 12:39:13 PM UTC-6, Sam Duke wrote:
>
> Due to the nature of config changes, the runnable submitted to 
> runOnUiThread may be executed after an activity has been destroyed (i.e. on 
> a stale activity). Therefore this API can cause all sorts of subtle bugs 
> with config changes and events never reaching the UI. I can't think of a 
> single case where it would be safe to use this. You should already have hit 
> the main thread by the time you are doing anything inside the runnable... I 
> think all it does is encourage poor patterns...
>
> Given this, is it not time to deprecate this API?
>
>
>

-- 
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
--- 
You received this message because you are subscribed to the Google Groups 
"Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to