Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-25756

Android: Restart app on system locale change


    • Story Points:
    • Sprint:
      2018 Sprint 06 SDK, 2018 Sprint 07 SDK, 2018 Sprint 08 SDK, 2018 Sprint 09 SDK, 2018 Sprint 10 SDK, 2018 Sprint 11 SDK, 2018 Sprint 12 SDK, 2018 Sprint 13 SDK, 2018 Sprint 14 SDK, 2018 Sprint 15 SDK, 2018 Sprint 16 SDK, 2016 Sprint 17 SDK, 2018 Sprint 18 SDK, 2018 Sprint 19 SDK, 2018 Sprint 20 SDK, 2018 Sprint 21


      Apps in Titanium doesn't restart the activities when locale config has changed and the broadcast event is fired.

      From the documentation:


      "Locale" The locale has changed; the user selected a new text language.

      As you can see in the documentation page. If android:configChanges are added to the manifest in an activity block is the app who should handle this changes. If not, the app is restarted by default (as expected).

      I found this broadcast handler in the titanium source code but the behaviour isn't as expected.

      Adding 'locale' to android:configChange doesn't works.

      Generated and modified manifest (adding locale to android:configChanges):

      		<activity android:name=".AppTestActivity" android:label="@string/app_name" android:theme="@style/Theme.Titanium" android:configChanges="keyboardHidden|orientation|fontScale|screenSize|smallestScreenSize|screenLayout|density|locale">
      				<action android:name="android.intent.action.MAIN"/>
      				<category android:name="android.intent.category.LAUNCHER"/>

      I've tried removing android:configChanges attribute in my custom manifest to get the default behaviour but it is added again.

      By default the generated manifest by Titanium has the android:configChanges flag enabled with custom properties. It's Titanium who handles this changes.

      TEST APP:

      Languages: en, es

      Expected behaviour: Settings > Languages > Change language > Come back to app > Activity has been restarted with new language
      Current behaviour: Settings > Languages > Change language > Come back to app > Activity hasn't been restarted with new language




            • Assignee:
              gmathews Gary Mathews
              jormagar Jorge Macias Garcia
              Joshua Quick
              Lokesh Choudhary
            • Watchers:
              1 Start watching this issue


              • Created:

                Backbone Issue Sync

                • Titanium SDK/CLI <> Titanium Mobile
                  Synced with:
                  Sync status:
                  Last received:
                  Last sent:

                  Git Integration