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

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.

Posts: 10
Registered: ‎01-16-2013
My Device: BB7 and BB10
My Carrier: Airtel

Back button to go back to previous screen and close button on menu to exit the app



I am developing an application for BB os 7.1 using eclipse plugin.


I have used

public boolean onClose(){
        int response = Dialog.ask(Dialog.D_YES_NO,
            "Are you sure you want exit?");
        if (response == -1)
            return false;
        } else
            return true;



Suppose i am in screen 3 and click on back button, i must go back to screen 2 but now i get pop up for exiting the screen and also when i click on menu--> close i get the popup for exiting the app..


My requirement is to go back to the previous screen on click of back button and when i click menu--> close I must get a pop up for exiting the app.


I hope I am clear about my question.


Can anybody please help me out on this



Thanks in advance



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

Re: Back button to go back to previous screen and close button on menu to exit the app

Unfortunately I don't think that Close and onClose can distinguish between the back button and the Close menu item. So I think the only option you have to to provide your own close menu item that has the functionality that you want, replacing the System generated one.


But in fact I would not recommend that you do that.  BB users expect both the back button and menu-->close to take them back one screen. So if you wish to give the BB user the option to exit the application then provide your own Exit menu item.  Let Close and back do what they normally do.