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