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