{ "id": "119586", "key": "TIMOB-15094", "fields": { "issuetype": { "id": "4", "description": "An improvement or enhancement to an existing feature or task.", "name": "Improvement", "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": [], "resolution": null, "resolutiondate": null, "created": "2013-09-06T14:19:01.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "exalture" ], "versions": [ { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" } ], "issuelinks": [], "assignee": null, "updated": "2018-02-28T20:04:04.000+0000", "status": { "description": "Submitted for code review", "name": "In Review", "id": "10003", "statusCategory": { "id": 4, "key": "indeterminate", "colorName": "yellow", "name": "In Progress" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Like discussed in TIMOB-7360 (SDK 1.8.x) Android natively doesn't really support {{pause}}/{{resume}} events for the app as a whole, but only for separate activities within the app.\r\n\r\nHowever, since both closing the current heavyweight window and closing the app fire the exact same {{pause}} event on that window, there is no way to workaround, making this a critical issue!\r\n\r\nHaving talked about this with several developers and trying multiple workarounds without much success, [~rborn] remembered [~iamyellow] actually did got this working in a [fork of the 2.1.x Titanium SDK|https://github.com/iamyellow/titanium_mobile/commits/2_1_X_iamyellow].\r\n\r\nI have cloned the current branch and it seems the 2 commits involved should still work. I can't get the SDK to build on my system (never been there) to verify, but since this is such an frustrating parity problem I kindly ask to have a look at the 2 commits and consider pulling them into the SDK.\r\n\r\nI know [~iamyellow] would be happy to be of help.\r\n\r\n* Main commit: https://github.com/iamyellow/titanium_mobile/commit/42ccc574cd2a285b68aebfa4a4bb88fd9b8becce\r\n* Commit to fix triggering the events for {{TiLaunchActivity}}'s: https://github.com/iamyellow/titanium_mobile/commit/73ed97415bf9a12ca1d1849eba4c889f6b51f4ba", "attachment": [], "flagged": false, "summary": "Android: Support Titanium.App pause/resume events", "creator": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "subtasks": [], "reporter": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "environment": "SDK 3.1.2.GA", "comment": { "comments": [ { "id": "270166", "author": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The only downside that I see to this would be if someone were to ever build a Titanium App which has a Android Widget activity. I wouldn't want pause/resume to impact both the main activity (the app) and the widget activity together.\n\nCurrently, the only way to do an Android Widget with Titanium is via a module and the AndroidManifest.xml file.\n\n", "updateAuthor": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-07T14:21:06.000+0000", "updated": "2013-09-07T14:21:06.000+0000" }, { "id": "270173", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Never heard anyone doing an Android Widget in Titanium and I'm sure we can add a check for that?", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2013-09-07T15:00:23.000+0000", "updated": "2013-09-07T15:00:23.000+0000" }, { "id": "270174", "author": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "body": "You've never heard of it because I'm working on that module right now.\n", "updateAuthor": { "name": "sophrinix", "key": "sophrinix", "displayName": "Andrew McElroy", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-09-07T16:57:43.000+0000", "updated": "2013-09-07T16:57:43.000+0000" }, { "id": "289097", "author": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "body": "Any progress on this? I know it's a hack and that Android natively doesn't really support watching if an app (task) goes to the background and foreground, but this really would be useful in lots of cases, like:\r\n\r\n* Updating content when a user returns to the app\r\n* Pausing app-wide (multiple activities, so {{allowBackground}} must be {{true}}) music\r\n* ..", "updateAuthor": { "name": "fokkezb", "key": "fokke", "displayName": "Fokke Zandbergen", "active": true, "timeZone": "Europe/Amsterdam" }, "created": "2014-01-21T19:39:57.000+0000", "updated": "2014-01-21T19:39:57.000+0000" }, { "id": "298811", "author": { "name": "kriskit", "key": "kriskit", "displayName": "Chris Kitch", "active": true, "timeZone": "Europe/London" }, "body": "This would be really useful for my needs. I need to do a particular check every time the app resumes, works a treat on iOS. It seems a shame for me to have to add an event to every single window on the off chance that it might be the one that was last active when I need to perform something on a global scope.", "updateAuthor": { "name": "kriskit", "key": "kriskit", "displayName": "Chris Kitch", "active": true, "timeZone": "Europe/London" }, "created": "2014-03-26T16:37:12.000+0000", "updated": "2014-03-26T16:38:34.000+0000" }, { "id": "333804", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "https://github.com/appcelerator/titanium_mobile/pull/6402\r\nAdded support for app 'pause' and 'resume' events", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2014-11-26T03:12:43.000+0000", "updated": "2014-11-26T03:12:43.000+0000" } ], "maxResults": 6, "total": 6, "startAt": 0 } } }