Thank you for visiting the BlackBerry Support Community Forums.
BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)
BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.
"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."
- Kevin Michaluk, Founder, CrackBerry.com
Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.
08-22-2012 01:54 AM
Suppose there are 3 screens Screen A,Screen B,Screen C. From screen A i get navigated to screen B,from screen B i get navigated to screen C. When i am in screen C and if i press back button i am navigated to screen B. I want to write onexposed() in screen B.in this how can i know that from which screen i am navigating to screen B ?
Solved! Go to Solution.
08-22-2012 02:11 AM - edited 08-22-2012 02:14 AM
One thing u can do is...in some method in Screen B u can call "UiApplication.getUiApplication().getActiveScreen(
this to check the instance of current screen and accomplish ur task accordingly like popping or pushing new screen B or wat ever!!
08-22-2012 02:24 AM
For this u can also make ur own protocols in the following way--
1. Make constants denoting each screen;e.g
public static final int A=100
public static final int B=101
public static final int C=102
2.now declare a static var denoting the PREVIOUS SCREEN ,e.g
public static int PREVIOUS_SCREEN;
Now set the value of PREVIOUS_SCREEN on the basis of screen and retieve its value wherever you require.
08-22-2012 02:25 AM - edited 08-22-2012 02:27 AM
I didn't mean to push the screen B n check just call a method in screen B.... a static method or wat ever .. I should have asked u to call that getActiveScreen() from any where. Since u were referring to Screen B... I thought it would be the standard way to do... Any way getActiveScreen is probably the best way to accomplish ur task I wonder.. After u call that method u can push ur Screen B..
08-22-2012 02:29 AM
08-22-2012 04:44 AM
And another simple approach, which I like because it is 'self contained' (i.e. the logic is within the screen itself) is to set a flag appropriately, that you test in the onExposed. So if Screen B pushes Screen C, it sets this flag. Later, in onExposed(), when this flag is set, Screen B does whatever is needed (and resets the flag). If the flag is not set, Screen B does not do it.
So you can detect which Screen was pushed by the flag setting and act accordingly.
There is no way that onExposed() can be invoked, once you push the screen, until that screen has been closed/popped.