Android - check if running on main thread
public boolean runningOnMainThread() { return Looper.getMainLooper().getThread() == Thread.currentThread(); }