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: 1
Registered: ‎11-12-2010
My Device: Bold 9700
My Carrier: Vodacom

Newbie: How to invoke default BlackBerry Browser and load a url as the browser loads

[ Edited ]

Hi Guys,


I working on my first widget using Eclipse. It's really not a complicated widget. What I want to do is when the widget loads to open the default BB browser and load a weblink immediately. Once the browser loads the widget should die.


Can anyone help me out?



Posts: 1,055
Registered: ‎01-25-2009
My Device: BlackBerry Bold 9650/BlackBerry Torch 9800

Re: Newbie: How to invoke default BlackBerry Browser and load a url as the browser loads

[ Edited ]

1) The Web Development forum is a better place to post:


2) Here is your code:



<script type="text/javascript">
var args = new blackberry.invoke.BrowserArguments('http://www.yoursite.com');
blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);



Jerome Carty - Follow jcarty on Twitter@jcarty | #webworks-dev / #BlackberryDev on irc.freenode.net | My Apps
Click "Accept as Solution" if post solved your original issue.. Give like/thumbs up if you feel post is helpful
New Contributor
Posts: 4
Registered: ‎05-16-2011
My Device: Blackberry Bold 9700
My Carrier: Telecom Italia Mobile

Re: Newbie: How to invoke default BlackBerry Browser and load a url as the browser loads

Dear Jerome,


I have tried your solution but on my BOLD 9700 the result is that the browser remain in background, if I remove

the blackberry.app.exit(); line the browser remains visibile but on back the screen of my widget appear.


How can I launch the browser and die my widget while leaving the browser in foreground?

May I register the callback for the onForeground event after invoking the browser in order to close the widget as soon as it comes back visible?


Thank You


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

Re: Newbie: How to invoke default BlackBerry Browser and load a url as the browser loads

I am a little confused by this requirement, so to clarify.


All you want is to have an icon on the Blackberry.  When the icon is pressed, a Web page is loaded in the standard Browser, then your application dies?


If that is correct, then you can write a very small java application, in it you will just start the Browser using this KB article.



Take you application to the background



Then start a Thread, that stalls for 5 seconds, and then issues a System.exit().


Job done I think. 



New Developer
Posts: 120
Registered: ‎05-20-2011
My Device: Touch 9800
My Carrier: Vodafone

Re: Newbie: How to invoke default BlackBerry Browser and load a url as the browser loads

Try this


BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig();
myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE, BrowserFieldConfig.NAVIGATION_MODE_POINTER);
BrowserField browserField = new BrowserField(myBrowserFieldConfig);
browserField.requestContent("your URL");