04-30-2012 06:15 AM
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.
04-30-2012 08:18 AM
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.
04-30-2012 09:09 AM
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.
04-30-2012 05:32 PM
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.