开发者

Android: I am getting reports of 'Can't create handler inside thread that has not called Looper.prepare()' after adding ScoreNinja

开发者 https://www.devze.com 2022-12-31 06:17 出处:网络
I am getting reports of \'Can\'t create handler inside thread that has not called Looper.prepare()\' once I added ScoreNinja to my Android app, and released it to the market.

I am getting reports of 'Can't create handler inside thread that has not called Looper.prepare()' once I added ScoreNinja to my Android app, and released it to the market.

It seems that it isn't happening all the time as the ScoreNinja highscore has lots of entries from users.

I have looked on the web for help but there are no clear directions on what to do.

I have used the ScoreNinja code exactly as开发者_运维问答 shown on the scoreninja website.

Thanks for any help.

Dave B

BTW If anyone is having problems with ScoreNinja only displaying one score, check to see if the launchmode is not set to 'singleinstance' in your manifest. This fixed it for me!


Make sure you initialize everything inside app lifecycle methods (e.g. onCreate()) and not as static final fields.


See:

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

It fixed it for me to call .show() in a normal activity after the game thread has ended.

0

精彩评论

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