protected final void runOnUiThread(@NonNull Runnable runnable){
  if (Looper.myLooper() == Looper.getMainLooper()) {
    runnable.run();
  }
 else {
    mPoster.post(runnable);
  }
}

protected final void runOnUiThread ( @ NonNull Runnable runnable ) { if ( Looper . myLooper ( ) == Looper . getMainLooper ( ) ) { runnable . run ( ) ; } else { mPoster . post ( runnable ) ; } }
runs a task on the ui thread . if caller thread is the ui thread , the task is executed immediately .
