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

    public boolean isMainThread() {
        return Looper.getMainLooper().getThread() == Thread.currentThread();
    }

你可能感兴趣的:(android,java,apache)