Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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

like image 797
jtam Avatar asked Dec 27 '22 18:12

jtam


1 Answers

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.

like image 68
Geoffroy Avatar answered Dec 31 '22 12:12

Geoffroy