In my AppDelegate's applicationDidEnterBackground() I call cocos2d::Director::getInstance()->stopAnimation() and in applicationWillEnterForeground() I call cocos2d::Director::getInstance()->startAnimation().
But applicationDidEnterBackground can be called with the game still visible on screen, and not only when the game is minimized with the home button (and becomes invisible), for example when you start a buy process in your game, and google billing shows it's popup. If you now rotate the screen with this popup active, the game screen goes all black and the result is a black screen with only the google billing dialog visible. The same happens if the google billing dialog is visible, and you minimize the app and then bring it back.
The only way I can fix this, is by NOT calling stopAnimation.
Does this have a negative impact on battery life, or will cocos2d-x automatically pause all actions while minimized?
The only way I can see how this can be fixed properly, is by knowing whether or not the game is still visible when it's being put in the background, which I could do by overriding the onStop() function on Android.
So how did others solve this? Did you chose to stop the animation and see the black screen as a minor side effect, or do you leave the animation running?
Pause/Resuming the Director has the same effect btw...
Any help would be greatly appreciated!
Kind regards, Mich