Android examples for java.lang:Thread
post On Ui Thread
//package com.java2s; import android.os.Handler; import android.os.Looper; public class Main { public static void postOnUiThread(Runnable action, long delayMillis) { if (delayMillis > 0) { new Handler(Looper.getMainLooper()).postDelayed(action, delayMillis);//from www. j a va2s.c o m } else { postOnUiThread(action); } } public static void postOnUiThread(Runnable action) { new Handler(Looper.getMainLooper()).post(action); } }