我在工作線程中獲取Runtime Exception:Can't create handler inside thread that has not called Looper.prepare() while displaying the Toast message
。顯示Toast消息時出錯:無法在未調用Looper.prepare()的線程中創建處理程序
我有一個服務(運行在遠程進程),它創建一個對象。該對象負責連接到線程中的服務器。我得到了服務器的迴應。我想在吐司服務器上顯示消息。那時我得到這個例外。我嘗試使用handler.post在Handler中發佈它。但我仍然得到例外。
應該怎樣避免這種情況。
[看這個](http://www.google.com/search?client=ubuntu&channel=fs&q=that+has+not+called+Looper.prepare%28%29&ie=utf-8&oe= UTF-8) –
把你的服務代碼 –