java - Manipulate the url a webview gets before it starts loading -


i add current location request variable url's loaded in webview can use information on page without reloads or requests.

i have webviewclient shouldoverrideurlloading doesn't receive requests when passed using loadurl. read it's possible intercept requested url using shouldinterceptrequest i'm on api level 8 , don't want change this.

is there way manipulate url before gets loaded webview?

yes, change url before call loadurl. can create 1 function modifies url , call loadurl , in shouldoverrideurlloading

public url addlocationtourl(url url) {       url newurl = url;     //do url     return newurl; }     loadurl(addlocationtourl(someurl));  //and in webviewclient @override public boolean shouldoverrideurlloading(webview view, string url) {     mwebview.loadurl(addlocationtourl(someurl));     return true; } 

Comments

Popular posts from this blog

php - cannot display multiple markers in google maps v3 from traceroute result -

c# - DetailsView in ASP.Net - How to add another column on the side/add a control in each row? -

javascript - firefox memory leak -