CCApplication


#1

Hi,

The following two functions are defined in CCAplication:

virtual void applicationDidEnterBackground() = 0;
virtual void applicationWillEnterForeground() = 0;

However, they not called by the framework anywhere. Are they supposed to be called by cocos2d-x or by application code?

Thanks & regards,


#2

hello, Leon, as the comments of the two functions showing, these two functions are callback functions.
you could realize them in your own apllication if you have something to do when you enter the background or enter the foreground.

/***
brief The function be called when the application enter backgroundparam the pointer of the application
**/
virtual void applicationDidEnterBackground() = 0;


#3

Thank you, RongHong. The problem is that these function are not called by cocos2d-x. My question is should the framework be modified so these function get called somewhere or should I call these function in my app code?


#4

oh, I have found the functions through out the whole project of cocos2d-x, and they are not called by the framework.
it seems that they should be called through jni in your own app code,
this is my opinion, hope that it is helpful for you.

btw, about jni, you can refer to http://www.cocos2d-x.org/boards/10/topics/2595?r=2902#message-2902


#5

Thank you for making it clear.