Esempio n. 1
0
  public void exit() {
    finish();
    // 延迟半秒杀进程
    new Handler(Looper.getMainLooper())
        .postDelayed(
            new Runnable() {

              @Override
              public void run() {
                AndyLog.i("andygzyu", "kill process in main called.last create time");
                Process.killProcess(Process.myPid());
              }
            },
            800);
  }
Esempio n. 2
0
 public static Scheduler getUiThreadScheduler() {
   return shadowOf(Looper.getMainLooper()).getScheduler();
 }
Esempio n. 3
0
 public static void assertMainThread() {
   if (Looper.myLooper() != Looper.getMainLooper()) {
     throw new RuntimeException();
   }
 }