Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
Posts: 143
Registered: ‎07-14-2008
My Device: Not Specified

best practices question - when sending an app to the background

Say you have a game application with a "Hide" menu option, which calls requestBackground() to send the application to the background.

 

Is there anything special one should do in deactivate() ?  I would guess that unless the game was using a large amount of resources, one would need do nothing at all.  On the other hand, if the game had a large amount of memory tied up, then one might save the state of the game and then free up memory as the game is sent to the background, and then restore the game when it was brought back into the foreground.

 

Sound right?

 

Highlighted
Developer
Posts: 5,339
Registered: ‎09-20-2008
My Device: ***
My Carrier: ***

Re: best practices question - when sending an app to the background

You're right.

 

When your game goes to background state - it would be better to save the application state and free the resources.