无法以编程方式使用Android 8.0.0更改Google Pixel中的区域设置

Nis*_*ith 5 android

我需要将我的应用程序语言从英语更改为中文.我可以在许多设备上执行此操作,但Google Pixel除了Android 8.0.0之外.我正在使用以下代码

public static void changeLocaleTo(String locale){

            Resources res = App.getContext().getResources();
            DisplayMetrics dm = res.getDisplayMetrics();
            android.content.res.Configuration conf = res.getConfiguration();
            conf.setLocale(new Locale(locale.toLowerCase())); // API 17+ only.
            conf.locale = (new Locale(locale.toLowerCase()));
            res.updateConfiguration(conf, dm);
            //for Build>=25
            //res.createConfiguration(conf, dm); 
}
Run Code Online (Sandbox Code Playgroud)

我使用以下链接尝试了很多东西

如何以编程方式更改语言?

https://gunhansancar.com/change-language-programmatically-in-android/

但没有人能够改变我的Pixel手机中的语言.

请注意:但是,如果我从设备设置更改设备语言,我的应用程序也会更改为Pixel中的中文版.

我在res中有'values-zh'文件夹,有中文字符串.