0

While loading my game, I catch back buttons home and back, so the assets are loaded. But when the game starts on tab device i can press Show running apps button and the game will crash. As I have searched, navigation bar can be hidden. But how to just catch this single button until the game is not loaded and release it afterwards?

Also is there an option to hide whole bar and show it after assets are loaded?

Edit:

The best answer i could find was in this thread, but it is done in layout: how do you remove the navigation bar on android

Community
  • 1
  • 1
raco
  • 398
  • 1
  • 5
  • 18

1 Answers1

0

The answer is not to remove or hide the button to show running apps, but to gracefully handle being put into the background.

Even if you hide this button, a user's phone can still put your app in the background when another app asks. (For example, when the phone rings, the phone app might get to take over the screen independent of what state your app is in.)

Generally, when switching away from your application Libgdx will run its "pause" hook. You probably have code in there that isn't expecting to run until all your initialization is completed. See https://code.google.com/p/libgdx/wiki/ApplicationLifeCycle or http://bitiotic.com/blog/2013/05/23/libgdx-and-android-application-lifecycle/ for more details.

P.T.
  • 24,557
  • 7
  • 64
  • 95