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

Regular Contributor
Posts: 89
Registered: ‎05-31-2010
My Device: 8100
My Carrier: tmobile
Accepted Solution

Return to main Screen



i have 3 screens... when the user make click in a button in the screen A... i send to screen B... and when the user make click in a Button in this screen i send to screen C.


Now i need put a buttton in the screen for what the user can return to screen A.. (home) if i use the key "arrow back" from the device return to screen B. and later Screen A.. so what i can do?

Posts: 1,305
Registered: ‎01-21-2009
My Device: Not Specified

Re: Return to main Screen

The display "stack" is not strictly a stack. You can pop a screen that is not at the top. So to do what you want, when you push screen C, you could pop screen B behind the scenes. However, users typically expect the "arrow back" key (actually, the ESCAPE key) to return to the previous screen. This scheme would run counter to that--when they pressed ESCAPE from screen C, they would go back to A (which is what you want, but not typical for BB apps.)


If you want the ESCAPE key to go back to screen B and have a separate button on screen C to return to screen A, just write the field change listener for the button to pop (or close) both C and B. Screen C would need to have (or be able to find) a reference to screen B.


Another approach is to have only a single screen and have three "modes": A, B, and C. When switching between modes, remove all fields and add the fields appropriate for the desired mode. The ESCAPE key--unless you override the default behavior--would then always exit the application (since there's only one screen).

Solved? click "Accept as solution". Helpful? give kudos by clicking on the star.