{ "id": "62543", "key": "TIMOB-1911", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": "12095", "description": "", "name": "Sprint 2012-03", "archived": true, "released": true, "releaseDate": "2012-02-12" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "13070", "description": "Release 1.8 Service Pack 2", "name": "Release 1.8.2", "archived": true, "released": true, "releaseDate": "2012-02-29" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-02-10T19:50:29.000+0000", "created": "2011-04-15T03:05:22.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "android", "feature" ], "versions": [], "issuelinks": [ { "id": "15147", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "85137", "key": "TIMOB-7293", "fields": { "summary": "Android: App Freeze after being too much time in the background", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "15122", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "85137", "key": "TIMOB-7293", "fields": { "summary": "Android: App Freeze after being too much time in the background", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "17740", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "inwardIssue": { "id": "92315", "key": "TIMOB-9229", "fields": { "summary": "Android: Certain devices aren't able to survive on activity relaunch - splash screen hangs", "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" } }, "priority": { "name": "Critical", "id": "1" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2017-03-24T21:01:49.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": "{html}

Because of the cleanup code in TiUIWindow (see\r\nrelease()), Titanium apps can't survive an activity\r\nrelaunch. Even the simplest app:

\r\n
\r\n/*global Ti, Titanium, alert, JSON */\r\nTitanium.UI.setBackgroundColor('#000');\r\nTitanium.UI.createWindow({  \r\n    title:'Test',\r\n    backgroundColor:'#fff',\r\n    fullscreen: true,\r\n    exitOnClose: true\r\n}).open();\r\n
\r\n

To cause an activity relaunch, change the locale while the\r\nactivity is running. Example:

\r\n\r\n

What's happening can be shown in the attached\r\nrelaunch_activity.png graphic. Apparently Android forces the\r\nactivity to relaunch if the locale has changed. This causes\r\nonDestroy, which in our code results in the window\r\ncleaning up itself, but then activity create occurs again. Now the\r\nhandler object is null, however, and all views are\r\ngone.

\r\n

Is there some way for us to determine if onDestroy\r\nis occurring because of a relaunch?

{html}", "attachment": [ { "id": "18075", "filename": "relaunch_activity.png", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:05:23.000+0000", "size": 172489, "mimeType": "image/png" }, { "id": "25684", "filename": "SendLog (2).txt", "author": { "name": "echeng", "key": "echeng", "displayName": "Eric Cheng", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-08T15:27:36.000+0000", "size": 152840, "mimeType": "text/plain" } ], "flagged": false, "summary": "Android: Titanium apps can't survive an activity relaunch", "creator": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "126963", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "{html}

Assigning to Don for milestone/priority.

{html}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2011-04-15T03:05:23.000+0000", "updated": "2011-04-15T03:05:23.000+0000" }, { "id": "126964", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Need to add locale to the list of things we handle\nin the activity definitions in the AndroidManifest.xml see \nAndroid Docs

\n

What I'm not clear of is if we should fire a\nlocaleChange event to the activity. It might be a good\nthing to do.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:05:23.000+0000", "updated": "2011-04-15T03:05:23.000+0000" }, { "id": "181813", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We have suggested a way to fix this issue to Pedro and awaiting feedback from him.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-04T11:01:13.000+0000", "updated": "2012-02-04T11:01:13.000+0000" }, { "id": "181815", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "Adding the android:alwaysRetainTaskState=\"true\" flag to the root activity in the manifest section of the tiapp.xml should address the problem of the black screen for the root activity. The following is an example snippet from the Kitchen Sink tiapp.xml\r\n\r\n{code}\r\n\r\n\r\n \r\n \r\n \r\n \r\n\r\n\r\n{code}", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2012-02-04T12:26:21.000+0000", "updated": "2012-02-04T12:26:21.000+0000" }, { "id": "181951", "author": { "name": "nderzhak", "key": "nderzhak", "displayName": "Nikolai Derzhak", "active": true, "timeZone": "America/Phoenix" }, "body": "This issue latest notification was not sent due to JIRA mail setting. Fixed now. Please check the issue for latests changes.", "updateAuthor": { "name": "nderzhak", "key": "nderzhak", "displayName": "Nikolai Derzhak", "active": true, "timeZone": "America/Phoenix" }, "created": "2012-02-06T06:36:17.000+0000", "updated": "2012-02-06T06:36:17.000+0000" }, { "id": "182474", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "We need to investigate the black screen issue with the work around.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-08T15:33:53.000+0000", "updated": "2012-02-08T15:33:53.000+0000" }, { "id": "182828", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "h3. Testing notes\r\n\r\n\r\nThe app should now be forced to re-start when the condition is recognized. To test it, put a Titanium app that has multiple heavyweight windows in it, or a TabGroup (like KitchenSink), on the device, and also put Astro or Advanced Task Killer on the device. Then these steps:\r\n\r\n* Open the Titanium App. Bring it to a state where at least one heavyweight window (or a TabGroup) is open. Then...\r\n* Press the Home key/button to go to the home screen, keeping the Titanium App fully loaded.\r\n* Now open your favorite task killer app.\r\n* Kill the Titanium App.\r\n* Restart the Titanium App.\r\n\r\nYou will likely see a flicker while Titanium realizes the condition it's in (an unsupported restart from Android, whereby Android attempts to first show the Activity that was top-most at the time the app was killed, rather than going through the \"normal\" launch sequence) and then forces a full re-start.\r\n\r\nIf the app hangs or otherwise stays in a non-functional state, then it's a fail. That's expected when you're testing the fail case with Titanium 1.8.1, but if you're testing the fix branch and this happens, then reject the Pull Request and shed a tear for me.\r\n", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-02-10T17:05:09.000+0000", "updated": "2012-02-10T17:05:09.000+0000" }, { "id": "182830", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Pull request ready\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/1400", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-02-10T17:10:26.000+0000", "updated": "2012-02-10T17:10:26.000+0000" }, { "id": "182909", "author": { "name": "sanderbeck", "key": "sanderbeck", "displayName": "Sander Beck", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Unfortunately..., the problem persists.", "updateAuthor": { "name": "sanderbeck", "key": "sanderbeck", "displayName": "Sander Beck", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-13T08:23:37.000+0000", "updated": "2012-02-13T08:23:37.000+0000" }, { "id": "182964", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Let us know the build you are using. Did you add the android:alwaysRetainTaskState=\"true\" flag to the root activity in the manifest section of the tiapp.xml as per one of the comments in this bug?", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-13T13:57:34.000+0000", "updated": "2012-02-13T13:57:34.000+0000" }, { "id": "183977", "author": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "body": "SDK 1.8.2.v20120221114636 fixed this for me, and I'm *not* using {{android:alwaysRetainTaskState=\"true\"}}.\r\n\r\nHowever, the fix seems like a programmed workaround, in that the Black Screen of Death shows up for an instant, then the entire app goes away, then the app's starts up normally with the splash screen. The question is, why isn't the entire app going away in the first place, like other Android apps do? What's causing part of a Titanium app to stick around when the Android OS attempts to push it out of memory?", "updateAuthor": { "name": "bitshftr", "key": "bitshftr", "displayName": "Shawn Lipscomb", "active": true, "timeZone": "America/New_York" }, "created": "2012-02-22T13:19:06.000+0000", "updated": "2012-02-22T13:19:06.000+0000" }, { "id": "183979", "author": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "body": "I'd like to echo what Shawn has said, that the black screen issue is fixed by upgrading to the latest CI build of 1.8 or 2.0 and that the android:alwaysRetainTaskState=\"true\" isn't required. It seems that many times when the app errors, regardless of whether it's a user bug or a titanium bug, the app just closes and restarts (with messages about WIN DEATH and Tombstones) rather than giving a error popup like in earlier versions of Titanium and Rhino. I hope the Android team can look into this even though the task is resolved.", "updateAuthor": { "name": "jtoth", "key": "jtoth", "displayName": "Justin Toth", "active": true, "timeZone": "America/New_York" }, "created": "2012-02-22T13:31:03.000+0000", "updated": "2012-02-22T13:31:03.000+0000" }, { "id": "184003", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2012-02-22T14:48:58.000+0000", "updated": "2012-02-22T14:48:58.000+0000" }, { "id": "187670", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Eric - Please provide a test case that reproduces this issue. The test case in this ticket does not exhibit this behavior anymore.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-21T08:07:14.000+0000", "updated": "2012-03-21T08:07:14.000+0000" }, { "id": "187672", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Eric - You should open another ticket for this issue.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-21T08:07:46.000+0000", "updated": "2012-03-21T08:07:46.000+0000" }, { "id": "187746", "author": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "body": "@Eric - The question is if you can reproduce the issue with the test in this ticket. If not, please open another ticket with a test case.", "updateAuthor": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-03-21T11:35:51.000+0000", "updated": "2012-03-21T11:35:51.000+0000" }, { "id": "415774", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as fixed with reference to previous comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-24T21:01:49.000+0000", "updated": "2017-03-24T21:01:49.000+0000" } ], "maxResults": 28, "total": 28, "startAt": 0 } } }