0

i have problem switching locale language while app is still running, how to do that? Thanks. I have read lot of docs... and still do not find solution.

Kyle Trauberman
  • 25,414
  • 13
  • 85
  • 121

2 Answers2

1

Sample code in Changing Locale within the app itself

Community
  • 1
  • 1
Vincent Mimoun-Prat
  • 28,208
  • 16
  • 81
  • 124
0

Be careful, changing the locale on the fly isn't officially supported! You have to take care of refreshing every text yourself! In my case, as I don't have many UI elements, I just did button1.setText(R.string.hello); button2.setText(R.string.bye); after chaning the locale.

Vladislav Zorov
  • 2,998
  • 19
  • 32
  • so, do you have any suggestion, or alternative ? – Emir Zaimovich Apr 08 '11 at 09:42
  • The alternative is to change the locale in the device settings (it can be done programmatically, but requires extra permissions in the manifest) and reload the whole application. Many users won't like you changing their settings, though. – Vladislav Zorov Apr 10 '11 at 12:16