Java tutorial
//package com.java2s; import android.os.Handler; public class Main { private static Handler main; public static void foreDelay(final Runnable r, final long millSeconds) { main.postDelayed(new Runnable() { @Override public void run() { try { r.run(); } catch (Throwable e) { e.printStackTrace(); } } }, millSeconds); } }