Android basics: running code in the UI thread
None of those are precisely the same, though they will all have the same net effect. The difference between the first and the second is that if you happen to be on the main application thread when executing the code, the first one (runOnUiThread()) will execute the Runnable immediately. The second one (post()) always puts the Runnable at the end of …