Java tutorial
//package com.java2s; import android.os.Handler; import android.os.Looper; public class Main { public static Handler mMainHandler; public static void removeCallbacks(Runnable runnable) { getMainThreadHandler().removeCallbacks(runnable); } public static Handler getMainThreadHandler() { if (mMainHandler == null) { mMainHandler = new Handler(Looper.getMainLooper()); } return mMainHandler; } }