caipivara
5/9/2015 - 4:05 PM

Android - check if running on main thread

Android - check if running on main thread

public boolean runningOnMainThread() {
        return Looper.getMainLooper().getThread() == Thread.currentThread();
}