Created
October 19, 2015 14:27
-
-
Save oded-regev/20d0232eea8551c295d6 to your computer and use it in GitHub Desktop.
Android - Adding Advertiser ID param to all url in webview Raw
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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