Java tutorial
//package com.java2s; import android.os.Handler; import android.os.Looper; public class Main { private static Handler mainHandler; private static void internalRunOnUiThread(Runnable runnable, long delayMillis) { getMainHandler(); mainHandler.postDelayed(runnable, delayMillis); } public static Handler getMainHandler() { if (mainHandler == null) { mainHandler = new Handler(Looper.getMainLooper()); } return mainHandler; } }