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

Web and WebWorks Development

Reply
Developer
calgacus
Posts: 237
Registered: ‎07-20-2010
My Device: Not Specified

my app closes before it opens the browser, why?

I am making a tiny app which just opens the browser to a web app.  When it runs the first time it seems to skip the open browser code and jump to the exit command.  After that however it works as expected.

Code in my index.html header:

 var args = new blackberry.invoke.BrowserArguments('http://www.mysite.com/wap');
    blackberry.invoke.invoke(blackberry.invoke.APP_BROWSER, args);
    blackberry.app.exit();
	</script>

 Thats all this app is meant to do, open the browser to a given page and quit.  Is there a better way to make such apps for BB devices?  On iOS users can make their own webclips and I just have to put a  few html tags  to dess them up right  such as hiding browser bars - can I hide browser bars when programmatically opening the browser on the BB?

 

PS: Such as by pointing my config content element at the website - but won't doing that open the site inside my app rather than in the browser - difference being the browser seems to perform better but the app will not have the browser bars.

thanks

Please use plain text.
Developer
shnuffy
Posts: 268
Registered: ‎08-19-2009
My Device: Bold 9700

Re: my app closes before it opens the browser, why?

Could be caused by race condition - your exit is being hit right away before the invoke call can complete. Try setting the app to exit after 5 seconds to check:

 

setTimeout("blackberry.app.exit", 5000);

 

Please use plain text.
Developer
calgacus
Posts: 237
Registered: ‎07-20-2010
My Device: Not Specified

Re: my app closes before it opens the browser, why?

where would I put that line?

Please use plain text.