Java 无法更改Webview语言
我的活动中有一个Webview,每次我打开哪个网站,它都会以印度语加载该网站,而我总是希望用户选择语言或至少将默认语言设置为英语 尝试Java 无法更改Webview语言,java,android,xml,webview,locale,Java,Android,Xml,Webview,Locale,我的活动中有一个Webview,每次我打开哪个网站,它都会以印度语加载该网站,而我总是希望用户选择语言或至少将默认语言设置为英语 尝试 setLocale(Locale.ENGLISH); public void setLocale(Locale locale){ Resources resources = getApplicationContext().getResources(); Configuration configuration = resources.getCo
setLocale(Locale.ENGLISH);
public void setLocale(Locale locale){
Resources resources = getApplicationContext().getResources();
Configuration configuration = resources.getConfiguration();
Locale.setDefault(locale);
configuration.setLocale(locale);
getApplicationContext().getResources().updateConfiguration(configuration,
resources.getDisplayMetrics());
}
及
我甚至尝试过这个答案,但网站仍在加载其他语言的内容。我认为尝试所有语言都很有帮助。无任何帮助@NensiKasundraok我会检查
Locale.setDefault(...);
Locale.getDefault(...);