java.lang.RuntimeException

Can't create handler inside thread that has not called Looper.prepare()


Samebug tips1

Any worker thread runs in background, since it is not intended to loop, is not connected to a Looper.for example doInBackground(). its implementation returns will be passed to onPostExecute() which runs on the UI thread.

Don't give up yet. Our experts can help. Paste your full stack trace to get a solution.


Solutions on the web18865

Solution icon of coderanch
Can't create handler inside thread that has not called Looper.prepare()

Solution icon of github
via GitHub by ntanduc2288
, 1 year ago
Can't create handler inside thread that has not called Looper.prepare()

Solution icon of github
via GitHub by itvdonsk
, 5 months ago
Can't create handler inside thread that has not called Looper.prepare()

Solution icon of github
via GitHub by AnmAtAnm
, 7 months ago
Can't create handler inside thread that has not called Looper.prepare()

Solution icon of github
via GitHub by awadeyar
, 7 months ago
Can't create handler inside thread that has not called Looper.prepare()

Solution icon of github
Can't create handler inside thread that has not called Looper.prepare()

Solution icon of github
Can't create handler inside thread that has not called Looper.prepare()

Solution icon of github
Can't create handler inside thread that has not called Looper.prepare()

Solution icon of github
Can't create handler inside thread that has not called Looper.prepare()

Solution icon of github
Can't create handler inside thread that has not called Looper.prepare()

Stack trace

  • java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() at android.os.Handler.<init>(Handler.java:200) at android.os.Handler.<init>(Handler.java:114) at com.wolter.WebViewActivity$OpenWebviewTask.doInBackground(WebViewActivity.java:541) at com.wolter.WebViewActivity$OpenWebviewTask.doInBackground(WebViewActivity.java:512) at android.os.AsyncTask$2.call(AsyncTask.java:288) at java.util.concurrent.FutureTask.run(FutureTask.java:237) at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:231) at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1112) at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:587) at java.lang.Thread.run(Thread.java:841)

Write tip

You have a different solution? A short tip here would help you and many other users who saw this issue last week.

Users with the same issue

Once, 2 months ago
131 times, 1 year ago
13 times, 1 year ago
5 times, 1 year ago
2 times, 1 year ago
35 more bugmates