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
New Developer
Posts: 85
Registered: ‎12-02-2013
My Device: 9360 Curve
My Carrier: BSNL
Accepted Solution

How to Open blackberry web browser with a given url by a button click.

Hello everyone,

 

I am developing a application in which i want to open blackberry web browser with a  given URL using a button click.How can i do this. i am using this code inside button listener

 

 

public void fieldChanged(Field field, int context) {
                // TODO Auto-generated method stub
               BrowserSession browserSession = Browser.getDefaultSession();
                  browserSession.displayPage("http://www.google.com");
                  }

 

is this a correct way to do this? please help me.....

Developer
Posts: 16,637
Registered: ‎07-29-2008
My Device: Z10 LE, Z30, Passport
My Carrier: O2 Germany

Re: How to Open blackberry web browser with a given url by a button click.

yes
----------------------------------------------------------
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
New Developer
Posts: 85
Registered: ‎12-02-2013
My Device: 9360 Curve
My Carrier: BSNL

Re: How to Open blackberry web browser with a given url by a button click.

Thank you very much simon.