Because you don't always have an Activity easily accessible? Besides:
>> 1. public final void runOnUiThread(Runnable action) { 2. if (Thread.currentThread() != mUiThread) { 3. mHandler.post(action); 4. } else { 5. action.run(); 6. } 7. } 8. << -- K 2012/9/11 bob <b...@coolfone.comze.com> > runOnUiThread? > > Why have I been using Handler.post this whole time? > > > > On Monday, September 10, 2012 3:41:53 AM UTC-5, Harri Smått wrote: > >> >> On Sep 10, 2012 12:04 AM, "Edvinas Kilbauskas" <edvinask...@gmail.com> >> wrote: >> > I heard that android doesn't support plain old Java Threads. >> >> That's not true. Android supports basic Java Threads and there's no >> reason for not to use them when appropriate. But the thing is, you can not >> alter UI components outside of UI Thread. In your case it would be updating >> the textual contents of TextView. See method named runOnUiThread , it gives >> easy access for executing UI code from Threads. >> >> -- >> H >> > -- > 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 > -- 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