Android判断当前线程是否是主线程的方法

方法一:使用Looper类判断

Looper.myLooper() == Looper.getMainLooper()

方法二:通过查看Thread类的当前线程

Thread.currentThread() == Looper.getMainLooper().getThread()

posted @ 2015-05-29 17:09  guoliuya  阅读(368)  评论(0编辑  收藏  举报