iOS WebBrowser retains the screen area when navigating off the Form

40 views
Skip to first unread message

steve...@more4apps.com

unread,
Nov 7, 2013, 3:08:10 AM11/7/13
to codenameone...@googlegroups.com
I have a WebBrowser component on a Form. When I navigate off the Form, the WebBrowser component stays on the screen. This only happens on iOS, its fine on the simulator and on Android. I have tried to destroy on Form exit:

  // Destroy the web browser (hopefully)
    @Override
    protected void exitLoginForm(Form f) {
        WebBrowser browser = findLoginWebBrowser();
        browser.destroy();
    }

All this does is leave a large white space where the Web Browser component was. The phone is on iOS 7.


Thanks,

Steve

Shai Almog

unread,
Nov 7, 2013, 1:41:31 PM11/7/13
to codenameone...@googlegroups.com, steve...@more4apps.com
This is likely triggered because of interaction with the form off the EDT. You need to make sure that all invocations to Codename One happen on the EDT.
shouldNavigate is problematic in that regard since by definition it will expose the native browser thread.

Steve West

unread,
Nov 7, 2013, 1:44:24 PM11/7/13
to Shai Almog, codenameone...@googlegroups.com
OK so how do I interact with the browser without running into this problem? I need to detect the URL that is being displayed so I can enable a button once the user has logged in through the browser.


On 8 November 2013 07:41, Shai Almog <shai....@gmail.com> wrote:
This is likely triggered because of interaction with the form off the EDT. You need to make sure that all invocations to Codename One happen on the EDT.
shouldNavigate is problematic in that regard since by definition it will expose the native browser thread.



--


Best regards,

Steve West

Shai Almog

unread,
Nov 7, 2013, 2:06:51 PM11/7/13
to codenameone...@googlegroups.com, Shai Almog, steve...@more4apps.com
Something like this:
public void shouldNavigate(String url) {
     if(url is the right url) {
         Display.getInstance().callSerially(new Runnable() {
            public void run() {
                 modify the button the way you see fit, navigate to different form etc.
            }
         });
     }
     return true;
}

Steve West

unread,
Nov 7, 2013, 2:29:49 PM11/7/13
to Shai Almog, codenameone...@googlegroups.com
OK working in the simulator (but it didn't have the problem anyway), I will try it on the device now and see if it makes a difference.

Thanks,

Steve

steve...@more4apps.com

unread,
Nov 11, 2013, 3:08:07 AM11/11/13
to codenameone...@googlegroups.com, Shai Almog, steve...@more4apps.com
No, it doesnt work. Same behaviour, the webBrowser component stays on the top of the App. Its fine in Android and Simulator. I have wrapped the code in a Runnable block. What could I be doing wrong?

Thanks,

Steve

Shai Almog

unread,
Nov 11, 2013, 12:14:11 PM11/11/13
to codenameone...@googlegroups.com, Shai Almog, steve...@more4apps.com
Hard to tell, since you are a pro user please just send us the code with instructions to reproduce and we'll take a look at this.
Reply all
Reply to author
Forward
0 new messages