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. New to the forum? Please visit the ‘Getting Started’ link below.
inside custom component

Java Development

Reply
Developer
shreyasb
Posts: 152
Registered: ‎07-17-2009
Accepted Solution

How to open a link in browser on Image click?

I have created a clickable image. Now I want to open a link in browser on Image click.

 

How to achieve it?

Please use plain text.
Developer
simon_hain
Posts: 13,830
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: How to open a link in browser on Image click?

call Browser.getDefaultSession().displayPage(String url)
----------------------------------------------------------
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
shreyasb
Posts: 152
Registered: ‎07-17-2009

Re: How to open a link in browser on Image click?

Hey Thanks a lot.. but its not opening in Simulator stating that "HTTP Bad Request".. why so?

Please use plain text.
Developer
simon_hain
Posts: 13,830
Registered: ‎07-29-2008
My Carrier: O2 Germany

Re: How to open a link in browser on Image click?

did you start the MDS simulator? the simulator browser needs it to connect.
----------------------------------------------------------
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
shreyasb
Posts: 152
Registered: ‎07-17-2009

Re: How to open a link in browser on Image click?

I m using Blackberry 4.5 & running the app. in Eclipse. When I right click on Project -> Debug as -> Blackberry Simulator, it automatically opens the MDS simulator. But then also the page is not opening after image click.

Please use plain text.
Developer
peter_strange
Posts: 17,722
Registered: ‎07-14-2008

Re: How to open a link in browser on Image click?

If the Browser is actually opening, then the code to invoke the browser is doing its job and you need to be sure that you are giving the browser the appropriate information (such as the correct URL). 

Please use plain text.
Developer
shreyasb
Posts: 152
Registered: ‎07-17-2009

Re: How to open a link in browser on Image click?

I gave URL on Image click as,

 

 

Browser.getDefaultSession().displayPage("http://www.google.com");

 

 

but

 

 

"HTTP Bad Request 400"

 

 

is coming & in Details

 

 

Unknown Host: www.google.com: 80

 

is coming.

 

Please use plain text.
Developer
aditya_BB
Posts: 26
Registered: ‎10-21-2009

Re: How to open a link in browser on Image click?

Hey,

 

I dont see why u cannot open with MDS running.

 

Just try opening GOOGLE from BlackBerry Browser also and check.

 

I tried same code, Its running fine for me.

 

---

Aditya

Please use plain text.
Developer
shreyasb
Posts: 152
Registered: ‎07-17-2009

Re: How to open a link in browser on Image click?

I m checking on "Blackberry Smartphone Simulator  2.9.0.52" for Blackberry Pearl. In its Browser alos, google.com is not opening but its opening in device. So any setting to make in Simulator ?

Please use plain text.
Developer
peter_strange
Posts: 17,722
Registered: ‎07-14-2008

Re: How to open a link in browser on Image click?

Can  you please confirm that the Browser is actually opening on the Device, but that it is not displaying your selected page?

 

Also can you tell us the device software you are developing on and the device OS level you are deploying to.

Please use plain text.