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()
.
This will help you:
runOnUiThread(new Runnable() {
@Override
public void run() {
// Your dialog code.
}
});