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

后端 未结 1 1206
独厮守ぢ
独厮守ぢ 2021-01-20 05:36

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

相关标签:
1条回答
  • 2021-01-20 06:02

    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.

    0 讨论(0)
提交回复
热议问题