判断当前线程是否是在主线程中

Looper.myLooper() == Looper.getMainLooper() 是可以帮助你确定你是否在主线程的代码。

原文地址:https://www.cnblogs.com/cmgrass/p/4994355.html