Skip to content

Instantly share code, notes, and snippets.

@oded-regev
Created October 19, 2015 14:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oded-regev/20d0232eea8551c295d6 to your computer and use it in GitHub Desktop.
Save oded-regev/20d0232eea8551c295d6 to your computer and use it in GitHub Desktop.
Android - Adding Advertiser ID param to all url in webview Raw
webView.setWebViewClient(new WebViewClient() {
@Override
public boolean shouldOverrideUrlLoading(WebView view, String url) {
if (url.contains("api_user_id")) {
return false;
}
url += (url.contains("?")) ? "&" : "?";
url += "api_user_id=";
url += "<AD_ID_FROM_SOMEWHERE_ELSE>";
view.loadUrl(url);
return true;
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment