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

Reply
Developer
simon_hain
Posts: 16,097
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
Please use plain text.
Developer
zany
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.
-------------------------------------------------------------------------------------------------------------------------------------------------------------------
Please use plain text.
Developer
mabs
Posts: 129
Registered: ‎09-21-2009
My Device: Not Specified

Re: disable back button

I have the same problem.

Please use plain text.
Developer
mabs
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

Please use plain text.
Contributor
goranzarkovic
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!

 

Please use plain text.
Developer
jack_black
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;  

 

 

Please use plain text.
Contributor
goranzarkovic
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

Please use plain text.
Developer
jack_black
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 :smileyindifferent:

Please use plain text.
New Contributor
tkrishna_07
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

Please use plain text.
New Member
Vpsingh04
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

Please use plain text.