0

I am relatively new to Android and want to know how to change the language of my app on the click of a button? I have extracted all the text and stored was string resources and set up new string resource files for each of the languages. My problem is around the mainActivity.java class.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Muz77
  • 1

1 Answers1

0

There is a library for the behaviour you want. It is called the localization library. You have to extend the libraries LocalizationActivity. You can than use setLanguage("en"); to change the language of your application at runtime. There is also a sample project available on the libraries GitHub page.

Rockney
  • 10,380
  • 2
  • 20
  • 26