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
Contributor
Posts: 17
Registered: ‎11-19-2010
My Device: Nexus One
My Carrier: Vodafone
Accepted Solution

OS5+ BrowserField: Problem closing the browser automatically on redirects

I'm trying to create a browser field, look for redirects and close the page, hence moving back to the last page. Listening on the browser field after requesting a page, and getting calls such as documentLoad(), I try to close the screen there. But I get a IllegalStateException: close()  called when not displayed.

 

I could not find anywhere else to listen for redirect events. Is there a better place to look for events in  browserField.addListener(...) ? One of the methods, BrowserFieldListener.downloadProgress() doesn't event get called.

 

 

BlackBerry Development Advisor
Posts: 15,784
Registered: ‎07-09-2008
My Device: BlackBerry PRIV
My Carrier: Bell

Re: OS5+ BrowserField: Problem closing the browser automatically on redirects

Did you wrap the close call in an invokeLater call?  Refer to the link below for an example.

 

Update a screen on the Main Event Thread

http://supportforums.blackberry.com/t5/Java-Development/Update-a-screen-on-the-Main-Event-Thread/ta-...

 

 

Mark Sohm
BlackBerry Development Advisor

Please refrain from posting new questions in solved threads.
Problem solved? Click the Accept As Solution button.
Found a bug? Report it using Issue Tracker
New Contributor
Posts: 7
Registered: ‎01-07-2011
My Device: Not Specified

Re: OS5+ BrowserField: Problem closing the browser automatically on redirects

downloadProgess() listener call never gets invoked in os 5.0. Is there a solution for that?