Skip to content Skip to sidebar Skip to footer

Add Parameter To Url In Webview

In my app a webpage is loaded in a webview. With shouldOverrideUrlLoading() I can open links on that page in the same webview. But is there a way to append on all links a parameter

Solution 1:

in your method you can try it.

@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
    if (url.equals("example.com") || url.equals("http://example.com")) {
        url = url + "?mode=app";
    }
    view.loadUrl(url);
    return true;
}

Post a Comment for "Add Parameter To Url In Webview"