Search code examples
androidandroid-activitymultilingual

Change display language at runtime and recreate all activities


I want to be able to change the display language in my Android application at runtime without the need to restart the app. To do this I believe it is possible to recreate all of the running activities. The problem is I don't have any idea how to get a reference to all activities that haven't been destroyed by the ActivityManager.


Solution

  • Add "locale" property in your android:configChanges in all you activities and then override onConfigurationChanged() in activities and handle the language changes accordingly.

    More on http://developer.android.com/guide/topics/manifest/activity-element.html#config