How can I override Android WebView to use custom Accept-Language header?

倖福魔咒の 提交于 2019-12-31 03:02:30

问题


Is is possible to override Android WebView to use custom Accept-Language header?


回答1:


The current implementation of WebView already allows you to add headers using the following syntax:

Map<String, String> headers = new HashMap<String, String>();
headers.put("Accept-Language", "fr_fr");
mWebView.loadUrl("http://developer.android.com", headers);

See WebView.loadUrl() for more information.



来源:https://stackoverflow.com/questions/12244375/how-can-i-override-android-webview-to-use-custom-accept-language-header

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!