I have created a bilingual (having two languages) android application. I have inserted my resource strings in two files:
For Persian language (default)
values/strings_locale.xml
For English language
values-en/strings_locale.xml
I my first launching Activity I have inserted the following code:
Configuration c = new Configuration(this.getResources().getConfiguration());
c.locale = new Locale("fa_IR");
this.getResources().updateConfiguration(c, this.getResources().getDisplayMetrics());
So after this code, my default language will be Persian and all of strings in all of Activities are shown in Persian language correctly.
But the problem is when the screen of the device is rotated, all of the strings are shown in English and it also happens for all other Activities! And I have to close and reopen my application.
Why this happens and how I can solve this problem?