How do I show dialog here? And end the game and go back to main activity after clicking ok from the dialog?
I am using Android Studio 2.2 on Ubuntu 16.04.
for (int i = 0; i < enemyCount; i++) {
broccolis[i].update(player.getSpeed());
if (Rect.intersects(player.getDetectCollision(), broccolis[i].getDetectCollision())){
//need to show dialog and change activity here...
}
}
I'm new to Android programming and Java so please keep that in mind.