经常会遇到判断当前线程是不是主线程(UI线程)今天记一下
Looper.getMainLooper().getThread() == Thread.currentThread();
Looper.getMainLooper().getThread().getId() == Thread.currentThread().getId();
Looper.getMainLooper() == Looper.myLooper();
经常会遇到判断当前线程是不是主线程(UI线程)今天记一下
Looper.getMainLooper().getThread() == Thread.currentThread();
Looper.getMainLooper().getThread().getId() == Thread.currentThread().getId();
Looper.getMainLooper() == Looper.myLooper();