Java tutorial
//package com.java2s; import android.os.Handler; import android.os.Looper; public class Main { private static void scheduleOnMainThread(Runnable r) { new Handler(Looper.getMainLooper()).post(r); } }