public static void verifyMainThread() {
        if (Looper.myLooper() != Looper.getMainLooper()) {
            throw new IllegalStateException(
                "Expected to be called on the main thread but was " + Thread.currentThread().getName());
        }
    }
Verify that the calling thread is the Android main thread.
<p>
Calls to this method are usually preconditions for subscription behavior which instances of
this class later undo. See the class documentation for an example.

@throws IllegalStateException when called from any other thread.
android/android_framework/base/src/main/java/rx2/android/MainThreadDisposable.java