12-16-2010 11:31 AM
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
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.
Solved! Go to Solution.
12-17-2010 04:12 AM
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.