Welcome!

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.


Reply
Developer
Posts: 17,025
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: disable back button

Menu menu2 = new Menu();

menu2.add....

 

create it like this. The makeMenu method is specifically for the default screen menu.

----------------------------------------------------------
feel free to press the like button on the right side to thank the user that helped you.
please mark posts as solved if you found a solution.
@SimonHain on twitter
Developer
Posts: 222
Registered: ‎11-11-2009
My Device: Storm

Re: disable back button

Hi,

    i can able to show my own menu when i click the back down, but the menu us showing at right top of the screen. can anyone tell me why is coming the right top. i used 9500 simulator for my testing.

 

  here is my sample code

 

        _menu = new Menu (Menu.INSTANCE_CONTEXT);
        menuitmem1 = new MyMenuItem ("Hi");
        menuitmem2 = new MyMenuItem ("Welcome");
        _menu.add(menuitmem1);
        _menu.add(menuitmem2);
....

 

    protected boolean keyDown(int keycode, int status)
    {
        if(Keypad.key(keycode) == Keypad.KEY_ESCAPE)
        {
            _menu.show();
            return true;
        }
        return false;
    }

with regards,
Vignesh J

-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Don't forget to mark your post as solved if you get the answer and dont forget to give kudos if the answer is useful for you.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Developer
Posts: 129
Registered: ‎09-21-2009
My Device: Not Specified

Re: disable back button

I have the same problem.

Developer
Posts: 129
Registered: ‎09-21-2009
My Device: Not Specified

Re: disable back button

just found this thread,

http://rim.lithium.com/t5/Java-Development/How-to-change-BB-Menu-position/m-p/274318

its not possible to change position.

 

Thanks all for your help

Contributor
Posts: 13
Registered: ‎04-22-2010
My Device: Blackberry Bold
My Carrier: AT&T

Re: disable back button

[ Edited ]

I am having a problem implementing this into my code. So I have a dialog screen that pops up and I only want the user to be able to choose yes or no via trackball, (so only trackball scroll and trackball clicking enabled) which means disabling all other buttons so the user cannot exit until an answered has been made.

Ive tried the following code with no luck, i keep getting the same five errors.

UiApplication uiApp = UiApplication.getUiApplication();
                    if (uiApp != null)
                    {
                        Dialog screen = new Dialog(Dialog.D_YES_NO, "This is a question?", Dialog.YES, 
                                Bitmap.getPredefinedBitmap(Bitmap.QUESTION), Manager.VERTICAL_SCROLL);
                        uiApp.pushGlobalScreen(screen, 1, UiEngine.GLOBAL_MODAL);
                        int answer = screen.getSelectedValue();
                        protected boolean keyDown(int keycode, int status)
                        {
                            if(Keypad.key(keycode) == Keypad.KEY_ESCAPE)
                            {
                                screen.show();
                                return true;
                            }
                            return false;
                        }
                        if (answer == Dialog.NO)
                        {
                            wasOfficial = false;
                        }
                    }

 

Any insight would be greatly appreciated.
Thanks!

 

Developer
Posts: 74
Registered: ‎01-03-2010
My Device: Not Specified

Re: disable back button

this does for me always

 

 

int i= Dialog.ask(Dialog.D_YES_NO,"Are you sure you want to quit !");
	        if(i>0 && i != -1)
	        { 
	            System.exit(0); 
	            return true; 
	        } 
	        return false;  

 

 

Contributor
Posts: 13
Registered: ‎04-22-2010
My Device: Blackberry Bold
My Carrier: AT&T

Re: disable back button

I understand what you are doing but how would you put that into my current code??

I already have a dialog set and all I want is for the trackball operations to be the only buttons active

Developer
Posts: 74
Registered: ‎01-03-2010
My Device: Not Specified

Re: disable back button

why pushing a dialog like screens? dialogs are popup screens, just go through the API doc, only ask/inform/alert is needed.

about trackwheel, check how to use KeypadListener.STATUS_TRACKWHEEL or TrackwheelListener class Smiley Indifferent

Highlighted
New Contributor
Posts: 7
Registered: ‎01-17-2011
My Device: Not Specified

Re: disable back button

I am developing an application in which I have a menu item 'logout'. How can I disable back button after logout.

 

- krishna

New Member
Posts: 1
Registered: ‎12-30-2012
My Device: 9220
My Carrier: Airtel

Blackberry 9220

hi

i have blackberry 9220. in my phone if i press any key some applecation open like - m - Mails, g - google talk, h - help.

 

i want to disable this option.

 

regards 

vanpal singh