Customize the user agent in WebView (Android)¶
Use setUserAgentString of WebSettings to customize the user agent.
The following is an example adding the string MY_CUSTOM_USER_AGENT
to the beginning of the original user agent.
final WebSettings settings = webView.getSettings();
settings.setUserAgentString("MY_CUSTOM_USER_AGENT " + settings.getUserAgentString());