{ "id": "63345", "key": "TIMOB-2713", "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": [], "resolution": { "id": "5", "description": "All attempts at reproducing this issue failed, or not enough information was available to reproduce the issue. Reading the code produces no clues as to why this behavior would occur. If more information appears later, please reopen the issue.", "name": "Cannot Reproduce" }, "resolutiondate": "2017-03-24T17:45:57.000+0000", "created": "2011-04-15T03:27:37.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "exitonclose" ], "versions": [], "issuelinks": [ { "id": "20173", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "94532", "key": "TIMOB-9901", "fields": { "summary": "TiAPI: Review and clean up platform bugs and reduce bug count by 20%.", "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": "7", "description": "gh.issue.story.desc", "name": "Story", "subtask": false } } } } ], "assignee": { "name": "ngupta", "key": "ngupta", "displayName": "Neeraj Gupta", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-31T17:21:37.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}

I want to exit from application from one screen. When i click\nthe android hardware back button from that screen the application\nshould be exit. I tried this with exitOnclose within window\ncreation but it doesn't work.

\n

This is my code:

\n

var win2 = Titanium.UI.createWindow({

\n
\ntitle:'Tab 2',\nurl:'example.js',\nbackgroundColor:'#fff',\n
\n

exitOnClose:true,

\n
\n        navBarHidden:false\n
\n

});

\n

I am using Titanium version 1.5.1 and android:sdk 2.1 also I\ntested with titanium 1.4.0

{html}", "attachment": [], "flagged": false, "summary": "exitOnclose event not working in android", "creator": { "name": "lakshmanan", "key": "lakshmanan", "displayName": "Lakshmanan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "lakshmanan", "key": "lakshmanan", "displayName": "Lakshmanan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "129243", "author": { "name": "krishnan", "key": "krishnan", "displayName": "krishnan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Did someone find a solution for this?

{html}", "updateAuthor": { "name": "krishnan", "key": "krishnan", "displayName": "krishnan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:27:37.000+0000", "updated": "2011-04-15T03:27:37.000+0000" }, { "id": "129244", "author": { "name": "skypanther1", "key": "skypanther1", "displayName": "skypanther", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Have you added an event listener on the back button?

\n

var win = Titanium.UI.currentWindow;
\nfunction closeWindow() {

\n
\nwin.close();\n
\n

} if(Titanium.Platform.name == 'android') {

\n
\nwin.addEventListener('android:back', closeWindow);\n
\n

} // end platform test

{html}", "updateAuthor": { "name": "skypanther1", "key": "skypanther1", "displayName": "skypanther", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:27:37.000+0000", "updated": "2011-04-15T03:27:37.000+0000" }, { "id": "129245", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Assigning to Don for triage.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:27:37.000+0000", "updated": "2011-04-15T03:27:37.000+0000" }, { "id": "216036", "author": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "body": "Tested on a Samsung Galaxy S2 using TiSDK 2.2.0v20120821095711, unable to reproduce the issue.\r\n\r\nTicket marked as resolved.\r\n\r\n{code}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'white'});\r\n\r\nwin.addEventListener('click', function(e)\r\n{\r\n var win2 = Ti.UI.createWindow({backgroundColor: 'yellow', exitOnClose: true});\r\n \r\n win2.open();\r\n});\r\n\r\nwin.open();\r\n{code} ", "updateAuthor": { "name": "jyounus", "key": "jyounus", "displayName": "Junaid Younus", "active": true, "timeZone": "Europe/London" }, "created": "2012-08-24T11:14:00.000+0000", "updated": "2012-08-24T11:14:00.000+0000" }, { "id": "416501", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as I am unable to reproduce the issue using the following environment; \r\nPixel (7.1) \r\nMacOS 10.11.6 (15G31) \r\nStudio 4.8.1.201612050850 \r\nTi SDK 6.0.3 GA \r\nAppc NPM 4.2.8 \r\nAppc CLI 6.1.0 \r\nTi CLI 5.0.11 \r\nAlloy 1.9.5 \r\nArrow 1.10.1 \r\nXcode 8.2 (8C38) \r\nNode v4.6.0 \r\nJava 1.7.0_80", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-31T17:21:37.000+0000", "updated": "2017-03-31T17:21:37.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }