Android examples for java.lang:Thread
is On Main Thread
//package com.java2s; import android.os.Looper; public class Main { /**//from w w w.ja v a2 s . c om * @deprecated use isOnUiThread */ @Deprecated public static boolean isOnMainThread() { return isOnUiThread(); } /** * Check to see whether current thread is also the UI Thread * * @return TRUE when current thread is the UI Thread */ public static boolean isOnUiThread() { return Looper.getMainLooper().getThread() == Thread.currentThread(); } }