public static void assertMainThread() { if (Looper.myLooper() != Looper.getMainLooper()) { throw new RuntimeException(); } }