{ "id": "170651", "key": "TIMOB-25756", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "20238", "description": "", "name": "Release 7.5.0", "archived": false, "released": true, "releaseDate": "2018-11-15" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2018-11-09T21:06:26.000+0000", "created": "2017-12-19T11:53:17.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "android:configChanges", "locale" ], "versions": [ { "id": "19957", "description": "", "name": "Release 7.1.0", "archived": false, "released": true, "releaseDate": "2018-03-14" } ], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-11-15T07:31:08.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Apps in Titanium doesn't restart the activities when locale config has changed and the broadcast event is fired.\r\n\r\nFrom the documentation:\r\n\r\nhttps://developer.android.com/guide/topics/manifest/activity-element.html#config\r\n\r\n\"Locale\" The locale has changed; the user selected a new text language.\r\n\r\nAs 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).\r\n\r\nI found this broadcast handler in the titanium source code but the behaviour isn't as expected.\r\n\r\nAdding 'locale' to android:configChange doesn't works.\r\n\r\nGenerated and modified manifest (adding locale to android:configChanges):\r\n\r\n{code:xml}\r\n\t\t\r\n\t\t\t\r\n\t\t\t\t\r\n\t\t\t\t\r\n\t\t\t\r\n\t\t\r\n{code}\r\n\r\nI've tried removing android:configChanges attribute in my custom manifest to get the default behaviour but it is added again.\r\n\r\nBy default the generated manifest by Titanium has the android:configChanges flag enabled with custom properties. It's Titanium who handles this changes.\r\n\r\n\r\nTEST APP:\r\n\r\nLanguages: en, es\r\n\r\nExpected behaviour: Settings > Languages > Change language > Come back to app > Activity has been restarted with new language\r\nCurrent behaviour: Settings > Languages > Change language > Come back to app > Activity hasn't been restarted with new language", "attachment": [ { "id": "63873", "filename": "android-lang-behaviour.gif", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2018-01-02T09:57:13.000+0000", "size": 1030671, "mimeType": "image/gif" }, { "id": "64805", "filename": "android-restart-app-when-language-changed.gif", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2018-02-05T07:29:29.000+0000", "size": 1817156, "mimeType": "image/gif" }, { "id": "63874", "filename": "app.zip", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2018-01-02T09:57:49.000+0000", "size": 7124503, "mimeType": "application/zip" }, { "id": "65842", "filename": "locale_8.1.gif", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-09T21:03:44.000+0000", "size": 552702, "mimeType": "image/gif" } ], "flagged": false, "summary": "Android: Restart app on system locale change", "creator": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "subtasks": [], "reporter": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "environment": null, "closedSprints": [ { "id": 1058, "state": "closed", "name": "2018 Sprint 16 SDK", "startDate": "2018-07-29T22:26:06.486Z", "endDate": "2018-08-12T22:26:00.000Z", "completeDate": "2018-08-13T17:38:16.757Z", "originBoardId": 114 }, { "id": 1028, "state": "closed", "name": "2018 Sprint 09 SDK", "startDate": "2018-04-22T22:53:08.928Z", "endDate": "2018-05-06T22:53:00.000Z", "completeDate": "2018-05-07T00:02:15.883Z", "originBoardId": 114 }, { "id": 1065, "state": "closed", "name": "2016 Sprint 17 SDK", "startDate": "2018-08-13T17:39:36.846Z", "endDate": "2018-08-27T17:39:00.000Z", "completeDate": "2018-08-29T16:10:57.013Z", "originBoardId": 114 }, { "id": 1034, "state": "closed", "name": "2018 Sprint 10 SDK", "startDate": "2018-05-07T00:03:21.636Z", "endDate": "2018-05-21T00:03:00.000Z", "completeDate": "2018-05-20T20:54:58.928Z", "originBoardId": 114 }, { "id": 1035, "state": "closed", "name": "2018 Sprint 11 SDK", "startDate": "2018-05-20T20:57:43.542Z", "endDate": "2018-06-03T20:57:00.000Z", "completeDate": "2018-06-04T15:13:14.425Z", "originBoardId": 114 }, { "id": 1070, "state": "closed", "name": "2018 Sprint 18 SDK", "startDate": "2018-08-26T16:14:35.297Z", "endDate": "2018-09-09T16:14:00.000Z", "completeDate": "2018-09-11T20:59:21.495Z", "originBoardId": 114 }, { "id": 1039, "state": "closed", "name": "2018 Sprint 12 SDK", "startDate": "2018-06-03T15:22:23.401Z", "endDate": "2018-06-17T15:22:00.000Z", "completeDate": "2018-06-18T20:45:36.363Z", "originBoardId": 114 }, { "id": 1008, "state": "closed", "name": "2018 Sprint 06 SDK", "startDate": "2018-03-11T22:18:04.396Z", "endDate": "2018-03-25T22:18:00.000Z", "completeDate": "2018-03-25T21:52:36.683Z", "originBoardId": 216 }, { "id": 1073, "state": "closed", "name": "2018 Sprint 19 SDK", "startDate": "2018-09-09T21:02:56.422Z", "endDate": "2018-09-23T21:02:00.000Z", "completeDate": "2018-09-23T22:28:10.932Z", "originBoardId": 114 }, { "id": 1045, "state": "closed", "name": "2018 Sprint 13 SDK", "startDate": "2018-06-17T20:47:13.621Z", "endDate": "2018-07-01T20:47:00.000Z", "completeDate": "2018-07-02T18:40:05.029Z", "originBoardId": 114 }, { "id": 1078, "state": "closed", "name": "2018 Sprint 20 SDK", "startDate": "2018-09-23T16:57:58.349Z", "endDate": "2018-10-07T16:57:00.000Z", "completeDate": "2018-10-07T23:31:40.476Z", "originBoardId": 114 }, { "id": 1018, "state": "closed", "name": "2018 Sprint 07 SDK", "startDate": "2018-03-25T21:59:36.637Z", "endDate": "2018-04-08T21:59:00.000Z", "completeDate": "2018-04-08T17:55:14.467Z", "originBoardId": 114 }, { "id": 1050, "state": "closed", "name": "2018 Sprint 14 SDK", "startDate": "2018-07-01T18:40:57.193Z", "endDate": "2018-07-15T18:40:00.000Z", "completeDate": "2018-07-16T03:27:08.720Z", "originBoardId": 114 }, { "id": 1084, "state": "closed", "name": "2018 Sprint 21", "startDate": "2018-10-07T23:32:40.560Z", "endDate": "2018-10-21T23:32:00.000Z", "completeDate": "2018-10-21T23:19:05.460Z", "originBoardId": 114 }, { "id": 1021, "state": "closed", "name": "2018 Sprint 08 SDK", "startDate": "2018-04-08T17:57:36.122Z", "endDate": "2018-04-22T17:57:00.000Z", "completeDate": "2018-04-22T22:51:19.120Z", "originBoardId": 114 }, { "id": 1053, "state": "closed", "name": "2018 Sprint 15 SDK", "startDate": "2018-07-15T21:52:05.453Z", "endDate": "2018-07-29T21:52:00.000Z", "completeDate": "2018-07-29T22:25:11.723Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "432567", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, Please provide a full reproducible code for us to test. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2017-12-27T21:40:05.000+0000", "updated": "2017-12-27T21:40:05.000+0000" }, { "id": "432624", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello [~jormagar],\r\n\r\nAre you able to sorted this out? If not ,please provide a sample test code to reproduce the issue on our end?\r\n\r\n\r\nBest ", "updateAuthor": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2018-01-02T09:38:36.000+0000", "updated": "2018-01-02T09:38:36.000+0000" }, { "id": "432625", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "body": "@Mostafizur Rahman, @Sharif AbuDarna, sorry for the delay. Just updated the ticket.\r\n", "updateAuthor": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2018-01-02T09:58:56.000+0000", "updated": "2018-01-02T09:58:56.000+0000" }, { "id": "434019", "author": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "body": "Hello, With the sample code you provided I wasn't able to reproduce the issue with Android 8.0.0. In SDK 7.0.1.GA. With language change, activity has been restarted with new language. Thanks.", "updateAuthor": { "name": "sdarda", "key": "sdarda", "displayName": "Sharif AbuDarda", "active": false, "timeZone": "Asia/Dhaka" }, "created": "2018-02-04T21:24:06.000+0000", "updated": "2018-02-04T21:24:06.000+0000" }, { "id": "434032", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "body": " !android-restart-app-when-language-changed.gif! \r\n\r\nI recompiled the test app with latest sdk 7.0.1 with Android 8 sim and it's not working. As you can see in the attached gif, you need to kill the app and open it again to get working the changed language.\r\n\r\nOn iOS platform it is done on the air and not need to kill / restart the app to see the new language.\r\n\r\nThe right behaviour on Android would be:\r\n\r\n- Open app and leave the app on background\r\n- Go to settings and change language\r\n- Come back to your running app from recent tasks.\r\n- App should be restarted by system.", "updateAuthor": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2018-02-05T07:34:11.000+0000", "updated": "2018-02-05T07:39:14.000+0000" }, { "id": "435651", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/9937", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-03-15T18:18:28.000+0000", "updated": "2018-03-15T18:18:28.000+0000" }, { "id": "437615", "author": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "body": "I think given that the PR is still marked a work in progress that this won't make the cut for 7.2.0. Bumping to 7.3.0 for now.", "updateAuthor": { "name": "cwilliams", "key": "cwilliams", "displayName": "Christopher Williams", "active": true, "timeZone": "America/New_York" }, "created": "2018-05-14T15:12:58.000+0000", "updated": "2018-05-14T15:12:58.000+0000" }, { "id": "442133", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-09-27T21:19:44.000+0000", "updated": "2018-09-27T21:19:44.000+0000" }, { "id": "442628", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-10-15T19:18:45.000+0000", "updated": "2018-10-15T19:18:45.000+0000" }, { "id": "442637", "author": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Verified the fix on SDK 7.5.0.v20181015122219 .Works fine. Closing\r\n{code} \r\nOperating System\r\n Name = Mac OS X\r\n Version = 10.13.6\r\n Architecture = 64bit\r\nNode.js\r\n Node.js Version = 8.9.1\r\n npm Version = 5.5.1\r\nTitanium CLI\r\n CLI Version = 5.1.1\r\nTitanium SDK\r\n SDK Version =7.5.0.v20181015122219\r\nDevice\t\t\t =Pixel 2 xl android 8 emulator\r\n{code}", "updateAuthor": { "name": "kmahalingam", "key": "kmahalingam", "displayName": "Keerthi Mahalingam", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2018-10-16T04:41:46.000+0000", "updated": "2018-10-16T04:41:46.000+0000" }, { "id": "443455", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "body": "It doesn't works fine... test app crashes on Android 8.1 simulator.\r\n\r\nSteps:\r\n\r\n1. Open test app and send it to background pressing on home button.\r\n2. Open language settings and set spanish to main language\r\n3. Open recent apps and select test app, it is restarted as expected. It could work or not.\r\n\r\nSee attached new GIF\r\n\r\n\r\n\r\n", "updateAuthor": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2018-11-09T12:53:52.000+0000", "updated": "2018-11-09T12:53:52.000+0000" }, { "id": "443456", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "body": "[Locale changed not solved|http://personales.upv.es/jormagar/gif/locale_changed_still_fail.gif]", "updateAuthor": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2018-11-09T12:56:08.000+0000", "updated": "2018-11-09T12:56:08.000+0000" }, { "id": "443466", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~jormagar], App will soft restart only when there is no locale change event listener. This is by design. I tried but not able to repro the crash.\r\n !locale_8.1.gif! ", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-09T21:01:42.000+0000", "updated": "2018-11-09T21:05:21.000+0000" }, { "id": "443467", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Had reopened to add a gif.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-09T21:06:27.000+0000", "updated": "2018-11-09T21:06:27.000+0000" }, { "id": "443469", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "body": "You are not trying what I'm reporting.\r\n\r\nFollow the steps to get the crash please.", "updateAuthor": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2018-11-10T11:42:54.000+0000", "updated": "2018-11-10T11:42:54.000+0000" }, { "id": "443497", "author": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "body": "[~lchoudhary] Can you check what the value of {{run-on-main-thread}} in tiapp.xml is in the application you ran? I was able to reproduce the crash with it when the property is set to false.", "updateAuthor": { "name": "ybanev", "key": "ybanev", "displayName": "Yordan Banev", "active": true, "timeZone": "Europe/Athens" }, "created": "2018-11-12T15:38:49.000+0000", "updated": "2018-11-12T15:38:49.000+0000" }, { "id": "443504", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~ybanev], I have it set to {{true}}\r\n{code}\r\ntrue\r\n{code}", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2018-11-13T05:25:31.000+0000", "updated": "2018-11-13T05:25:31.000+0000" }, { "id": "443627", "author": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "body": "@lchoudhary set it to false and see what happens with the app testing again the use case. You will check how it crashes.", "updateAuthor": { "name": "jormagar", "key": "jormagar", "displayName": "Jorge Macias Garcia", "active": true, "timeZone": "Europe/Brussels" }, "created": "2018-11-15T07:31:08.000+0000", "updated": "2018-11-15T07:31:08.000+0000" } ], "maxResults": 23, "total": 23, "startAt": 0 } } }