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: 41
Registered: ‎09-27-2010
My Device: 8900 Curve
Accepted Solution

Open browser and exit from application

Hello,

 

I need to open a browser with an URL, and to close the application (which has started the browser).

I need this behavior for the upgrading of the application.

OS >= 4.5

 

I've read http://www.blackberry.com/knowledgecenterpublic/livelink.exe/fetch/2000/348583/800332/800440/How_To_...

 

If I use launchBrowser() (BlackBerry Device Software earlier than 4.0), I receive a ControlledAccessException exception.

 

Also, I've found the net.rim.blackberry.api.invoke.Invoke class, but I don't see anything about browser.

 

If I use Browser.getDefaultSession().displayPage("http://www.BlackBerry.com");  the browser will appear, but when I want to finish the application, the browser will close too.

 

How can I open the browser and "kill" the application?

 

Thanks.


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

Re: Open browser and exit from application

i once wrote the weblaunchers for blackberryforums.com, quite some time ago...

i use Application as a basic class and call the code you mentioned:

Browser.getDefaultSession().displayPage("url")

and for good measure also

Browser.getDefaultSession().show()

 

the application finishs running with this and just exits, the browser continues.

in fact the browser is never closed, it always runs in the background.

----------------------------------------------------------
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