I looked at the source, and I'm not sure CodeA will execute before CodeB. Maybe try this?
handler.postAtFrontOfQueue(CodeB); handler.postAtFrontOfQueue(CodeA); Or create a new Runnable that simply calls the run methods on the other two Runnables in sequence? Thanks. On Wednesday, April 17, 2013 4:01:23 PM UTC-5, Filipe wrote: > > Hi, > > Thanks, this solves this problem. > But in my project I have severall situations where I need to post code to > run on the UI thread. > > If I call: > Handler.Post(CodeA) > Handler.Post(CodeB) > > Can I be sure that CodeA executes before CodeB? > In some situations it does not seem like it. > -- -- 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 unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.