java.lang.RuntimeException:Can‘t create handler inside thread that has not called Looper.prepare()

用handler時,出現這個異常。

handler的創建需要在主線程中,當在子線程中創建handler時會報這個錯誤


我是在子線程中創建Toast時報錯的


參考

http://blog.csdn.net/stonecao/article/details/6417364

http://www.oschina.net/question/163910_31439


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章