I’ve got an app that I’m trying to get to behave nicely on Android. Right now if you hit the home button the app will send a fatal signal 11 and you’ll have to go back to the main menu. I’ve got this code for sleeping the app.
void AppDelegate::applicationDidEnterBackground()
{
CCDirector::sharedDirector()->pause();
CCDirector::sharedDirector()->stopAnimation();
}
void AppDelegate::applicationWillEnterForeground()
{
CCDirector::sharedDirector()->startAnimation();
CCDirector::sharedDirector()->resume();
}
I heard something about using applicationWillResignActive on iPhone, but it seems like there isn’t a callback for that on Android.