is On Main Thread - Android Android OS

Android examples for Android OS:Thread

Description

is On Main Thread

Demo Code


//package com.java2s;
import android.os.Looper;

public class Main {
    public static boolean isOnMainThread() {
        return Looper.myLooper() == Looper.getMainLooper();
    }/*from  w  ww . j a v a2s.  co m*/
}

Related Tutorials