is On Ui Thread - Android java.lang

Android examples for java.lang:Thread

Description

is On Ui Thread

Demo Code


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

public class Main {
    public static boolean isOnUiThread() {
        return Thread.currentThread() == Looper.getMainLooper().getThread();
    }/*w  w  w .  j a  v a 2 s  .  c  o  m*/
}

Related Tutorials