草庐IT

superDelegate

全部标签

android - 迁移到 Androidx 后更改区域设置不起作用

我有一个支持多语言的旧项目。我要升级支持库和目标平台,在迁移到Androidx之前一切正常,但现在更改语言不起作用!我使用此代码更改App的默认语言环境privatestaticContextupdateResources(Contextcontext,Stringlanguage){Localelocale=newLocale(language);Locale.setDefault(locale);Configurationconfiguration=context.getResources().getConfiguration();configuration.setLocale(l