runOnUiThread

void runOnUiThread(Runnable action)

Runs the specified action on the UI thread. If the current thread is the UI thread, then theaction is executed immediately. If the current thread is not the UI thread, the action isposted to the event queue of the UI thread.

Parameters

action

the action to run on the UI thread