0

I have a arabic strings.xml file. I also have an English one.

In my settings activity, I want to be able to change the language used by the user. Like, is there a method like setStringResource(string.xml-ar)?

Veve
  • 6,643
  • 5
  • 39
  • 58
ASDev
  • 35
  • 8
  • Do you want to change the app language only? Because if you change the phone's language, system will automatically use the appropriate language strings for you application (if you have specified). Please be clear about what you exactly want. – Mangesh Jan 02 '16 at 10:09
  • @MangeshGhotage my app language only – ASDev Jan 02 '16 at 10:37

2 Answers2

0

duplication of Load language specific string from resource? check this one out.

Of course you must use Locale.AR or something like that for Arabic resource file.

Community
  • 1
  • 1
Tuna Yagci
  • 300
  • 1
  • 9
0

Keep your language specific xml strings in the necessary directories under resources

And change the locale as required

String language = "en";
String country = "US";
Locale locale = new Locale(language , country);
Community
  • 1
  • 1
johnrao07
  • 6,690
  • 4
  • 32
  • 55