SuspendInit

int SuspendInit(void(*callback)())

 

Specifies a function to be called when the application is about to enter the background.

 

Parameters

 

callback

Specifies the function to be called when the application is about to be sent into the background.

 

Remarks

 

Use SuspendInit() to specify a function to be called when your app is about to enter the background.  This will give you an opportunity to save data before your app gets terminated while in the background.  On iOS devices that support multitasking, AppExit() may never be called and this may be your only opportunity to clean up before iOS decides to terminate your app.

 

Availability

 

Available in DragonFireSDK 2.0 and later.

 

Example

 

The sample below specifies a function to be called when the app is about to enter the background on a device that supports multitasking.

 

#include "DragonFireSDK.h"

 

void OnSuspend()

{

   printf("App is about to enter the background!\n");

}

 

void AppMain()

{

   SuspendInit(OnSuspend);

}

 

void AppExit()

{

 

}

 

void OnTimer()

{

 

}