Saleh Refaai Saleh Refaai - 1 year ago 549
Android Question

Libgdx Back button exit the app

When I press back button on android, it exits the game although I ask it to go to other screen instead. It goes to the other screen for one or two seconds then it exits.:

game.setScreen(new GameOverScreen(game,4));
pausestate = false;

Answer Source

You also need to tell LibGDX to catch the back key from Android. This only needs to be done once so you can do this in the onCreate() method of your main class.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download