12-05-2010 02:12 PM - edited 12-05-2010 02:13 PM
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?
Thanks.
12-05-2010 04:16 PM - edited 12-05-2010 04:17 PM
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_BRO WSER, args);
blackberry.app.exit();
</script>
09-01-2011 01:35 PM
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
09-01-2011 05:11 PM
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.
http://supportforums.blackberry.com/t5/Java-Develo
Take you application to the background
<application>.(requestBackground();
Then start a Thread, that stalls for 5 seconds, and then issues a System.exit().
Job done I think.
09-03-2011 04:11 AM
Try this
BrowserFieldConfig myBrowserFieldConfig = new BrowserFieldConfig(); myBrowserFieldConfig.setProperty(BrowserFieldConfig.NAVIGATION_MODE, BrowserFieldConfig.NAVIGATION_MODE_POINTER); BrowserField browserField = new BrowserField(myBrowserFieldConfig); browserField.requestContent("your URL");