cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joe Bowser <bows...@gmail.com>
Subject [Android] WebView, InAppBrowser and UI Threads
Date Wed, 18 Sep 2013 21:21:24 GMT
I'm currently trying to figure out CB-4858, which got assigned to
David, but I'm finding that I'm getting stuck at this part:


    private String updateUrl(String url) {
        Uri newUrl = Uri.parse(url);
        if (newUrl.isRelative()) {
            //url = this.webView.getUrl().substring(0,
this.webView.getUrl().lastIndexOf("/")+1) + url;
        }
        return url;
    }

The problem with this code is that all methods on the WebView class
must run on the UI thread. Now, there's no easy way for us to pass
this data back because now we're doing asynchronous Java where we have
to wait for the UI thread to give us back the URL so we can find out
what our base path is.

We could override this in CordovaWebView, getting around the check,
but I think that this might not be the right thing to do.

Anyway, I'm content letting David chew on this, since I didn't know it
got assigned to him (JIRA didn't send me the e-mail), but I'd be
interested in seeing how this gets solved, because it's particularly
ugly.

Mime
View raw message