In Android in the webviews, the urls are passed as a plain text . If you wan to send suppose language in the header then its pretty simple.
The language should be in the two alphabet format like en, sv, it i.e.
en - English
sv - Swedish
it - Italian
"Accept-Language" is the keyword used to add the header in the webview
This can be found out easily from the web from many available sites:
the loadUrl(String url, Map<String, String> extraHeaders) method of the Webview allows to pass the language header.
This is the actual implementation :
Map<String, String> headers = new HashMap<>();
headers.put("Accept-Language",language));
mWebView.loadUrl(currentUrl,headers);
mWebView.loadUrl(currentUrl,headers);
No comments:
Post a Comment