04-16-2009 04:15 AM
I want to go back to previous screen on a press of button in my application.
Same thing as we go back by pressing "back arrow " button on blackberry.
What I need to call ? I mean if I want to go another screen then simply I can call that screen.
But here the scenario is :
I m at one of my screen and suddenly one msg comes in my app and I m showing that(msg) on screen(not popup) from that screen I want to go back
I can do it by pressing back arrow button on Blackberry .
But I want to give one OK button so that on click of it I will go back to previous screen
Thx in advance
Solved! Go to Solution.
04-16-2009 04:22 AM
Use PopScreen() method to pop up current screen.
Press the kudos button to thank the user who helped you.
If your problem was get solved then please mark the thread as "Accepted solution".
04-16-2009 04:45 AM
You can use:
04-16-2009 04:48 AM - edited 04-16-2009 04:49 AM
I would not agree with Deepesh since popScreen() method is depricated... Use popScreen(Screen screen) method instead ..
EDIT: was in edit mode ..
04-16-2009 06:24 AM
Thnx all to ur replies....
Its working using "UiApplication.getUiApplication().popScreen(this);
now I m able to put an OK button on click of which my previous screen is coming. Its working...
One more thing I want to ask: How to empty the stack which consists number of previous Screens.
Means as I m calling number of different Screens in application , they are stored in Stack ... right ? .. How to empty that stack ? Is JVM works here(garbage collector)??? if i m right
Or What is the solution ???
04-16-2009 06:27 AM
04-16-2009 06:29 AM
But the best practice I would suggest is, not to dump the display stack .. Pop the unnecessary screens immediately when you don't need that anymore ..
04-16-2009 06:37 AM
I m unable to uderstand this "the Pop the unnecessary screens immediately when you don't need that anymore .."
Is it to pop unnecessary screens using above same code ?
If yes then that code will popup the recent screen.
What about others which are left in stack ?
04-16-2009 06:57 AM
can be used ..