Is it possible to change the language of an app programmatically while still using Android resources?
If not, is it possible to request a resource in an specific language?
I would like to let the user change the language of the app from the app.
Is it possible to change the language of an app programmatically while still using Android resources?
If not, is it possible to request a resource in an specific language?
I would like to let the user change the language of the app from the app.
Alex Volovoy answer only works for me if it's in onCreate method of the activity.
The answer that works in all the methods is in another thread
Change language programmatically in Android
Here is the adaptation of the code
Hope that it helps.
The only solution that fully works for me is a combination of Alex Volovoy's code with application restart mechanism:
Important update:
Note, that on SDK >= 21, you need to call 'Resources.updateConfiguration()', otherwise resources will not be updated.
Locale
configuration
should be set in eachactivity
before setting the content -this.setContentView(R.layout.main);
If u write
in every activity than no need to set it every time you enter activity