I am developing an app which is to be opened directly in Portuguese language and inside that app it has having the option of changing the language to English. So i have to change the language in the code . But when i tested my app in Lollipop, it is directly opening in English Language. In all other versions except the lollipop , it is working fine. Can some one help me or suggest me the steps which i have to take to solve this bug. Thanks
Here is the code which i am using for the localization. Have some methods been "depreciated" from lollipop?
public static Locale locale = new Locale("pt_BR");
Locale.setDefault(locale);
android.content.res.Configuration config = new android.content.res.Configuration();
config.locale = locale;
this.getResources().updateConfiguration(config, null);
String locale = this.getResources().getConfiguration().locale
.getDisplayName();
Log.i("System out", "(LogIn)Current Language : " + locale);
You'll find this screen either in the System Settings app: Languages, or System Settings: System: Languages and input. The Language preference screen should contain one entry called “English (Europe)”. Click Add language and add a fallback language.
In order to localize the strings used in your application , make a new folder under res with name of values-local where local would be the replaced with the region. Once that folder is made, copy the strings. xmlfrom default folder to the folder you have created. And change its contents.
Due to some security issue --> java.lang.SecurityException: Permission Denial:
Language changing is not working, please try to change
Locale locale = Locale("en_US");
to
Locale locale = Locale("en", "US"); //Locale locale = Locale("language", "Country")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With