예제 #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);
  }
예제 #2
0
 public static Scheduler getUiThreadScheduler() {
   return shadowOf(Looper.getMainLooper()).getScheduler();
 }
예제 #3
0
파일: Util.java 프로젝트: gubo/slipwire
 public static void assertMainThread() {
   if (Looper.myLooper() != Looper.getMainLooper()) {
     throw new RuntimeException();
   }
 }