Entering background on Android

Entering background on Android
0.0 0

#1

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.


#2

Anyone have any idea what’s going on?


#3

Do you still get the fatal signal 11 crash if you comment out the start and stop animation lines?


#4

Just tested… Yeah.


#5

It doesn’t do it on iPhone.