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
gsk_56
Posts: 25
Registered: ‎09-08-2008
My Device: Not Specified
Accepted Solution

How maintain the same state of the application after close and reopen the applicaiton?

Hi,

 

My problem is while accessing the application if i close and reopen the application then the previous state of the application is getting loss.  Please help me to maintian the same state of the application after close and reopen the application means after reopen the application the application should have focus on last accessed component, and i have used browser component if i reopen the application, then browser content also be there as previous state.

 

Advanced Thanks for any help.

Please use plain text.
Developer
simon_hain
Posts: 15,834
Registered: ‎07-29-2008
My Device: Z10 LE
My Carrier: O2 Germany

Re: How maintain the same state of the application after close and reopen the applicaiton?

take a look at persistent store. how you store your information is up to you, you only need objects that implement persistable.
----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Please use plain text.
Developer
peter_strange
Posts: 19,598
Registered: ‎07-14-2008
My Device: Not Specified

Re: How maintain the same state of the application after close and reopen the application?

What Simon is suggesting is that at "Close", you save enough information to reconstruct your Application in the state it was, and restore this when it is reopened. 

 

Alternatively, instead of actually closing your application, you could just put it to the background using

 

UiApplication.getUiApplication().requestbackground();

 

Once in the background, when the user selects your application again it will start immediately and will be exactly as it was left.

 

This does not, off course, go through any shut-down or start up processing that you might wish it to, so, for example, will not tidy up any resources that you might wish to tidy up when you know the user is not going to use your application for a while.  To help with this, look at the Application.activate() and Application.deactivate() methods.

 

Hope this helps.

Please use plain text.
Developer
gsk_56
Posts: 25
Registered: ‎09-08-2008
My Device: Not Specified

Re: How maintain the same state of the application after close and reopen the application?

Thanks to Peter_strange and Simon_hain.

 

Please use plain text.