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
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL
Accepted Solution

how to remove open-link menu from browserfield

i hv browserfield using for ad display, i hv set protocolhandler to that to invoke browser ,
(i hv set navigation mode - caret)

but on clicking it first display menu as open link, i want it to open the link directly how i can do that ??

 


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.

Contributor
Posts: 45
Registered: ‎12-20-2010
My Device: Not Specified

Re: how to remove open-link menu from browserfield

Hi Ankit,

 

Try overriding the onMenu() method of the screen and iterate over the menu item, if the text of menu item is "open link" than call run() method of that menu item.

 

Something like this:

 

public boolean onMenu(int instance) {
                if (instance == Menu.INSTANCE_CONTEXT) {
                    // Retrieve the main menu
                    Menu mainMenu = this.getMenu(Menu.INSTANCE_DEFAULT);

                    int numItems = mainMenu.getSize();
                    for (int i = 0; i < numItems; i++) {
                        MenuItem curItem = mainMenu.getItem(i);
                        String name = curItem.toString();
                        if ("Open Link".equals(name)) {
                            curItem.run();
                            break;
                        }
                    }
                    return false;
                } else
                    return super.onMenu(instance);
}

 

If solved thn press kudos button.

Highlighted
Developer
Posts: 231
Registered: ‎03-16-2011
My Device: 9700, 9550, and JDE
My Carrier: AIRTEL, BSNL

Re: how to remove open-link menu from browserfield

hi roshni;

 

that cool..................... u saved my day Smiley Happy

 

thnks a lot


available on: Monday to Friday, Indian standard (day) time : )
  • Give kudos by clicking on the star icon to say "Thanks!" if you feel this response is helpful.
  • Click "Accept as Solution" if this post was what you needed. so that people who are trying to help will not waste their time reading a thread where no help is needed.