在调用 Looper.myLooper().quit() 的时候发现报 NullPointerException,通过 Android Studio 发现如下提示:
查阅了 Looper 的源码:
/** * Return the Looper object associated with the current thread. Returns * null if the calling thread is not associated with a Looper. */ public static @Nullable Looper myLooper() { return sThreadLocal.get(); }
Looper.myLooper().quit() 报 NullPointerException
原文:http://my.oschina.net/jerikc/blog/528701