我正在寻找最好的解决方案来更改应用程序中的语言,而不需要重新启动Android 7的应用程序。很多解决方案都包含一个不推荐使用的ex方法。Localelocale = new Locale("en_US"); Configuration config = new Configuration();
config.locale = lo
我为多种语言和多个设备定义了layouts,如下所示:我用自定义语言设置了适当的layout,如下所示:Localelocale= new Locale(languageToLoad);Configuration config = new Configuration();config.setLocale(locale);
getBase
我发现使用像“昨天”或"2小时前“这样的返回值的android.text.format.DateUtils相对API非常不错--但我的应用程序并不支持安卓所支持的所有语言。因此,我默认使用英语,但对于我不支持的每种语言,相关字符串都会显示在设备的设置中。Last attempt: hace 11 minutos.
我从这个线程获得了Android的setLocale方法。问题是Android Studio说locale is deprecated和updateConfiguration(android.content.res.Configuration.androidtil.DisplayMetcis/*- Set locale ------------------------------------------------------------ */
pu
private fun setLocale(lang: String) { val res: Resources= language val refresh = Intent(this, LoginActivity我已经为"en“和"ar”xml创建了字符串资源,并在Mainfest.xml android:suppo