is Ui Thread - Android java.lang

Android examples for java.lang:Thread

Description

is Ui Thread

Demo Code

import android.content.Context;

public class Main{

    public static boolean isUiThread(Context context) {
        return Thread.currentThread().equals(
                context.getMainLooper().getThread());
    }//w  w w  .java  2 s.com

}

Related Tutorials