如何使英语成为默认语言(android)

时间:2015-08-30 12:51:10

标签: android speech-recognition

我的应用程序使用语音到文本识别,如果我更改设备语言,我的应用程序无法正常工作。我想在我的应用程序中默认使用英语。我怎么能这样做?

1 个答案:

答案 0 :(得分:0)

 Locale myLocale;
 myLocale = new Locale("en");
 Locale.setDefault(myLocale);
 android.content.res.Configuration config = new android.content.res.Configuration();
 config.locale = myLocale;
 getBaseContext().getResources().updateConfiguration(config, getBaseContext().getResources().getDisplayMetrics());