Android 判断当前线程是否为主线程 public static boolean isInMainThread() { return Looper.myLooper() == Looper.getMainLooper(); }