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

Android: Restart app on system locale change

    Details

    • Story Points:
      5
    • 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

      Description

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

      From the documentation:

      https://developer.android.com/guide/topics/manifest/activity-element.html#config

      "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">
      			<intent-filter>
      				<action android:name="android.intent.action.MAIN"/>
      				<category android:name="android.intent.category.LAUNCHER"/>
      			</intent-filter>
      		</activity>
      

      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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Backbone Issue Sync

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

                  Git Source Code