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
New Developer
Posts: 60
Registered: ‎09-23-2011
My Device: Blackberry
My Carrier: Blackberry Developer

when application in background run next time How to launch different screen?

Hello Friends,

 

Please help me.

I am launching the application I am show the one screen.

 

Click on ok button application goes on background.

Next time I am click on icon show the same screen.

 

Please tell how to check the condition and show the different screen.

Super Contributor
Posts: 273
Registered: ‎11-23-2010
My Device: 9800 torch
My Carrier: Software Programmer

Re: when application in background run next time How to launch different screen?

in ur ui application class override  deactive method this will handle background actions.

 

 

i think this will helps you.

Developer
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: when application in background run next time How to launch different screen?

Just to clarify, the method called when an Application goes to the background is deactivate().  It is a method on the UiApplication class - well actually Applicatin, but I think you will have a UiApplication. 

Developer
Posts: 141
Registered: ‎07-13-2011
My Device: BB Bold
My Carrier: Vodafone

Re: when application in background run next time How to launch different screen?

Hi,

 

On Screen 1 override method onExposed to implement your logic to decide which screen to display.

 

onExposed called when you press the icon again after sending the app to background.

 

Set a boolean value in Screen 1...when displayed first time...

and when it is exposed check for the boolean value, and if it is set launch screen2.

 

Thanks

Rabi

New Developer
Posts: 60
Registered: ‎09-23-2011
My Device: Blackberry
My Carrier: Blackberry Developer

Re: when application in background run next time How to launch different screen?

Thanks..........

Highlighted
Developer
Posts: 19,631
Registered: ‎07-14-2008
My Device: Not Specified

Re: when application in background run next time How to launch different screen?

Be careful with onExposed(), it is invoked in quite a number of situations in addition to the screen being displayed because the Application has just be bought to the foreground.  You can actually use it, but you will probably want to override onObscured as well and detect if the Application has been taken to the background.  It is probably just as easy to use deactivate() to do this.