{ "id": "118844", "key": "AC-2581", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-08-23T18:17:27.000+0000", "created": "2013-08-21T04:42:21.000+0000", "labels": [ "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "updated": "2016-03-08T07:41:39.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "There is a problem to close lightweight windows on android, and this can be easily reproduced with the following code. In the example, four windows with different color are created, and will be close with back key, but only the latest windows can be closed, the other three can not.\r\n\r\nvar red = Ti.UI.createWindow({\r\n backgroundColor : 'red',\r\n top:0,\r\n height:100,\r\n});\r\nred.addEventListener('android:back', function() {\r\n red.close();\r\n});\r\nred.open();\r\n\r\nvar blue = Ti.UI.createWindow({\r\n backgroundColor : 'blue',\r\n top:100,\r\n height:100,\r\n});\r\nblue.addEventListener('android:back', function() {\r\n blue.close();\r\n});\r\nblue.open(); \r\n\r\nvar yellow = Ti.UI.createWindow({\r\n backgroundColor : 'yellow',\r\n top:200,\r\n height:100,\r\n});\r\nyellow.addEventListener('android:back', function() {\r\n yellow.close();\r\n});\r\nyellow.open(); \r\n\r\nvar green = Ti.UI.createWindow({\r\n backgroundColor : 'green',\r\n top:300,\r\n height:100,\r\n});\r\ngreen.addEventListener('android:back', function() {\r\n green.hide();\r\n});\r\ngreen.open(); \r\n ", "attachment": [], "flagged": false, "summary": "can not close lightweight windows on android", "creator": { "name": "support@p2premote.com", "key": "support@p2premote.com", "displayName": "user", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "support@p2premote.com", "key": "support@p2premote.com", "displayName": "user", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "android 3.1.1GA", "comment": { "comments": [ { "id": "267884", "author": { "name": "jbuckley", "key": "jbuckley", "displayName": "Jamie Buckley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi,\nI tried to reproduce this and noticed that the reason the other windows were not being closed is because you were not closing the green window, Instead it was being hidden:\n{code}\ngreen.hide();\n{code}\n\nOnce I changed this I was able to close all the windows with the back button, I hope this helps.\n\nP.S. I noticed you are using the android:back event which was deprecated in Titanium 3.0.0 and so may not be behave as expected, instead you should use androidback", "updateAuthor": { "name": "jbuckley", "key": "jbuckley", "displayName": "Jamie Buckley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-23T18:17:12.000+0000", "updated": "2013-08-23T18:17:12.000+0000" }, { "id": "280878", "author": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "body": "The user was using hide instead of close. ", "updateAuthor": { "name": "mpmiranda", "key": "mpmiranda", "displayName": "Mauro Parra-Miranda", "active": true, "timeZone": "America/Mexico_City" }, "created": "2013-11-24T04:18:49.000+0000", "updated": "2013-11-24T04:18:49.000+0000" } ], "maxResults": 2, "total": 2, "startAt": 0 } } }