ScoreNinja causes java.lang.RuntimeException: Can't create handler inside thread that has not called

Posted by sirconnorstack on Stack Overflow See other posts from Stack Overflow or by sirconnorstack
Published on 2010-04-08T22:22:11Z Indexed on 2010/04/08 22:23 UTC
Read the original article Hit count: 679

I'm trying to add ScoreNinja, the global high score system, to my Android game, and it works fine when I load it on my phone, but when I release it into the wild, I got crash reports saying:

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

Here is part of the call stack:

android.os.Handler.<init>(Handler.java:121)
android.app.Dialog.<init>(Dialog.java:99)
android.app.AlertDialog.<init>(AlertDialog.java:65)
android.app.AlertDialog.<init>(AlertDialog.java:61)
android.app.AlertDialog$Builder.create(AlertDialog.java:797)
android.app.AlertDialog$Builder.show(AlertDialog.java:812)
com.scoreninja.adapter.ScoreNinjaAdapter.show(ScoreNinjaAdapter.java:136)
com.scoreninja.adapter.ScoreNinjaAdapter.show(ScoreNinjaAdapter.java:99)

I thought the main thread had prepare() called automatically, and if not, why would it work fine for me but not anyone else?

© Stack Overflow or respective owner

Related posts about android

Related posts about highscores