Issue
I'm developing an Android Game.In this game, There are tracks on which trains run. This is running thread. I want to show an alert dialog when there is a collision between. when I'm applying alert dialog showing error can't create handler inside thread that has not called looper.prepare()
.
Solution
You must need to create AlertDialog
inside UI thread else it will never work. If you are in different thread use MessageHandler
or can use runOnUiThread
(using runnable) to create your dialog inside.
Answered By - Daud Arfin
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.