Is there a robust way to detect if Thread.currentThread() is the Android system UI thread in an application? I would like to put some asserts in my model co
Thread.currentThread()
I think that best way is this:
if (Looper.getMainLooper().equals(Looper.myLooper())) { // UI thread } else { // Non UI thread }