开发者

android error: Can't create handler inside thread that has not called Looper.prepare() [duplicate]

This question already has answers here: Can't create handler inside thread that has not called Looper.prepare() inside AsyncTask for ProgressDialog (4 answers) Closed 8 years ago.

I have an error from users of the android Market. I have no idea when this error occurs . The simulator and test phone runs the app perfectly! Any1 any idea where to begin looking? Thanks !

this is the error:

java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() at android.os.Handler.(Handler.java:121) at android.view.ViewRoot.(ViewRoot.java:259) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:148) at android.view.WindowManagerImpl.addView(WindowManagerImpl.java:91) at andr开发者_开发技巧oid.view.Window$LocalWindowManager.addView(Window.java:430) at android.app.Dialog.show(Dialog.java:288) at be.test.testerd$1.run(testscreen.java:103)


This can occur, if you have used AsyncTask and in doBackground() method is not called on Main UI thread, and calling a Toast or anyother thing which runs on Main UI thread.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜