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); }
public static Scheduler getUiThreadScheduler() { return shadowOf(Looper.getMainLooper()).getScheduler(); }
public static void assertMainThread() { if (Looper.myLooper() != Looper.getMainLooper()) { throw new RuntimeException(); } }