02-06-2012 12:14 AM
Hi guys,
I'm writing an application which invokes the browser and sends it a URL to open for the user. This is working perfectly on OS 4.6 to 5.0. However, on OS 6 and 7 the browser is always opened with two tabs; one includes the URL I'm trying to open and the other is the default BlackBerry browser page. Furthermore, the tab with the detaulf blackberry browser page is in focus and my users almost always miss to see that there's another tab open on their browser.
Has anyone seen this behavior before? If so, do you know how I can solve that problem?
Solved! Go to Solution.
02-09-2012 06:38 AM
Anyone has any idea what's wrong here you guys?
02-14-2012 07:03 PM
Hello anawara,
Can you share the code snippet, where you are configuring and invoking your browser, for us to take a look at?
Erik Oros
BlackBerry Development Advisor
03-17-2012 02:58 PM
Hi Erik,
I first use the BrowserSessionFactory found here then the following code runs
int i = Dialog.ask(Dialog.D_YES_NO,"Open website?");
if(i == Dialog.YES){
BrowserSession b = BrowserSessionFactory.createBISBrowserSession();
if(b == null){
b = BrowserSessionFactory.createBESBrowserSession();
if(b == null){
b = BrowserSessionFactory.createWAPBrowserSession();
if(b == null){
b = BrowserSessionFactory.createDefaultBrowserSession( );
}
}
}
String url = obj.getWebsite();
if(!url.startsWith("http"))
url = "http://"+url;
b.displayPage(url);
b.showBrowser();}
I am compiling on SDK 4.6. However, this behavior only happens with OS 6 since previous versions of the browser didn't have the multiple tabs feature
03-19-2012 02:45 PM
Hello anawara,
I'm working from memory here, but I believe that the call to b.displayPage(url) shows the browser to your URL, and then b.showBrowser() launches the 2nd tab. If you remove the call to b.showBrowser() on 6.0+, I believe that the second tab will not be created and only your URL will be displayed.
I'll double-check this in a sample, but I do recall thsi coming up before and am fairly sure that's where the issue stems from.
Erik Oros
BlackBerry Development Advisor
03-26-2012 11:24 AM