Android判断是否运行在主线程:
(1)通过Looper:
Looper.myLooper() == Looper.getMainLooper()
(2)通过looper中的Thread:
Thread.currentThread() == Looper.getMainLooper().getThread()
Android判断是否运行在主线程:
(1)通过Looper:
Looper.myLooper() == Looper.getMainLooper()
(2)通过looper中的Thread:
Thread.currentThread() == Looper.getMainLooper().getThread()
1331
4257

被折叠的 条评论
为什么被折叠?