{ "id": "110375", "key": "TIMOB-13339", "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": "15691", "description": "2013 Sprint 19", "name": "2013 Sprint 19", "archived": true, "released": true, "releaseDate": "2013-09-20" }, { "id": "15693", "description": "2013 Sprint 19 API", "name": "2013 Sprint 19 API", "archived": true, "released": true, "releaseDate": "2013-09-20" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-09-09T20:50:09.000+0000", "created": "2013-02-28T15:44:47.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "community", "module_api", "qe-testadded" ], "versions": [], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2013-10-23T23:15:19.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": "There isn't any good way to know if the user \"pauses\" an Android app. For example by hitting the home button. Listening for activity pause/resume for a multiple activity app can be really messy.\r\n\r\nMaybe also hook this feature into the Ti.App.pause(d) event?\r\n\r\nhttp://developer.android.com/reference/android/app/Activity.html#onUserLeaveHint()\r\n\r\n{code:js}\r\n\tvar win = Ti.UI.createWindow({\r\n\t\t backgroundColor : 'red',\r\n\t\t orientationModes : [Titanium.UI.PORTRAIT],\r\n\t\t exitOnClose : true,\r\n\t\t navBarHidden : true\r\n\t\t});\r\n\t\r\n\twin.addEventListener('open', function(){\r\n\t\twin.getActivity().addEventListener('userleavehint', function()\r\n\t\t\t\t{\r\n\t\t\tTi.API.info(\"Activity USER_LEAVE_HINT!!!!\");\r\n\t\t\t});\r\n\t});\r\n\t\t \r\n\twin.addEventListener('click', function()\r\n\t{\t\r\n\t var secondWin = Ti.UI.createWindow({\r\n\t backgroundColor : 'blue',\r\n\t orientationModes : [Titanium.UI.PORTRAIT],\r\n\t navBarHidden : true\r\n\t });\r\n\t \r\n\t secondWin.open();\r\n\t});\r\n\twin.open();\r\n{code}", "attachment": [], "flagged": false, "summary": "Android: Add support for onUserLeaveHint for activities", "creator": { "name": "jesper@x-com.se", "key": "jesper@x-com.se", "displayName": "Jesper Jonsson", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "jesper@x-com.se", "key": "jesper@x-com.se", "displayName": "Jesper Jonsson", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "comment": { "comments": [ { "id": "245816", "author": { "name": "jesper@x-com.se", "key": "jesper@x-com.se", "displayName": "Jesper Jonsson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Pause/resume should only be called when you leave the app, for example pressing the home buttom.\r\n\r\n{code:js} \r\nvar win = Ti.UI.createWindow({\r\n backgroundColor : 'red',\r\n orientationModes : [Titanium.UI.PORTRAIT],\r\n exitOnClose : true,\r\n navBarHidden : true\r\n});\r\n\r\nwin.addEventListener('click', function()\r\n{\r\n var secondWin = Ti.UI.createWindow({\r\n backgroundColor : 'blue',\r\n orientationModes : [Titanium.UI.PORTRAIT],\r\n navBarHidden : true\r\n });\r\n \r\n secondWin.open(); // Ti.App pause/resume will NOT fire here! Good!\r\n});\r\nwin.open();\r\n\r\nTi.App.addEventListener('pause', function()\r\n{\r\n Ti.API.log(\"PAUSE!!!!\");\r\n});\r\n\r\nTi.App.addEventListener('resume', function()\r\n{\r\n Ti.API.log(\"RESUME!!!!\");\r\n});\r\n{code}", "updateAuthor": { "name": "jesper@x-com.se", "key": "jesper@x-com.se", "displayName": "Jesper Jonsson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-04-04T22:11:37.000+0000", "updated": "2013-04-18T17:52:19.000+0000" }, { "id": "265876", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "This event is for the activity and will be fired when the activity goes to the background when opening the 'secondWin' which won't help providing the 'app' 'pause' event.", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-08-10T14:05:03.000+0000", "updated": "2013-08-10T14:05:03.000+0000" }, { "id": "269509", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "A new event 'userleavehint' is added to the activity\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/4647", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-09-04T17:49:19.000+0000", "updated": "2013-09-04T17:49:19.000+0000" }, { "id": "274586", "author": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Verified fix on:\r\nDevice : HTC desire V , Android version : 4.0.3\r\nSDK: 3.2.0.v20131008154043\r\nCLI version : 3.2.0\r\nOS : MAC OSX 10.8.4\r\nAlloy : 1.2.2\r\nAppcelerator Studio, build: 3.2.0.201310092427\r\nXCode : 5", "updateAuthor": { "name": "pmishra", "key": "pmishra", "displayName": "Paras Mishra", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-10-10T12:42:20.000+0000", "updated": "2013-10-10T12:42:20.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }