{ "id": "63470", "key": "TIMOB-2838", "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": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2011-04-15T03:30:46.000+0000", "created": "2011-04-15T03:30:44.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [ "android", "defect", "scrollview" ], "versions": [], "issuelinks": [], "assignee": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-09T23:18:23.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}

When I click to reopen a window I get multiple instances of that\nwindow. Either it is being opened twice the 2nd time or never\nreally closed. Please see the example code for a better\nexplanation.

\n
\nTitanium.UI.setBackgroundColor('#000');\n\nvar win1 = Titanium.UI.createWindow({\n\nbackgroundColor:'#000',\nexitOnClose:true,\nnavBarHidden:true,\norientationModes: [Ti.UI.PORTRAIT],\nzIndex:-1\n});\n\nwin1.open();\n\nvar win3 = Titanium.UI.createWindow({\n\ntitle: 'Window 3',\nname: 'Window 3',\nbackgroundColor: '#C4D5DA',\nfullscreen: false,\nanimate: ({opacity: 0,duration: 300 }),\nurl: 'win3.js'\n});\n\nwin3.open();\n
\n

win3.js

\n
\nvar win3 = Titanium.UI.currentWindow;\n\nvar body = Titanium.UI.createScrollView({\ncontentWidth:Titanium.Platform.displayCaps.platformWidth,contentHeight:500,\nright:0,left:0,top:60,bottom:50,width:'auto',height:'auto',\nshowHorizontalScrollIndicator:false,showVerticalScrollIndicator:false});\n\nwin3.add(body)\n\nvar button = Titanium.UI.createButton({\ntitle:'click to cycle',\ntop:190,\nleft:30,\nheight:50,\nwidth:250,\nfont:{fontSize:20}\n});\n\nbody.add(button);\nbutton.addEventListener('click', function(){\n\nwin3.close();\nwin3.open();\n});</code>\n
{html}", "attachment": [], "flagged": false, "summary": "Reopening a window opens it twice", "creator": { "name": "pete", "key": "pete", "displayName": "pete", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "pete", "key": "pete", "displayName": "pete", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "129520", "author": { "name": "pete", "key": "pete", "displayName": "pete", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This happens only on Android.

\n

is there an echo in here?...

{html}", "updateAuthor": { "name": "pete", "key": "pete", "displayName": "pete", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:45.000+0000", "updated": "2011-04-15T03:30:45.000+0000" }, { "id": "129521", "author": { "name": "pete", "key": "pete", "displayName": "pete", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Please someone at least acknowledge this bug. My app works\nperfectly on iPhone but unless this bug is fixed for Android, there\nis no point in me using this software

{html}", "updateAuthor": { "name": "pete", "key": "pete", "displayName": "pete", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:45.000+0000", "updated": "2011-04-15T03:30:45.000+0000" }, { "id": "129522", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

You can't close and reopen the same window that you're in.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:46.000+0000", "updated": "2011-04-15T03:30:46.000+0000" }, { "id": "129523", "author": { "name": "pete", "key": "pete", "displayName": "pete", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

That was just for simplicity sake. I have modified my code to\nnot open/close from the same window with the same result.

\n

app.js

\n
\nTitanium.UI.setBackgroundColor('#000');\n\nvar win1 = Titanium.UI.createWindow({  \n    backgroundColor:'#000',\n    exitOnClose:true,\n    navBarHidden:true,\n    orientationModes: [Ti.UI.PORTRAIT],\n    zIndex:-1\n});\n\nwin1.open();\n\nvar body = Titanium.UI.createScrollView({\n    right:0,left:0,top:60,bottom:50,width:'auto',height:'auto'\n    });\n    \nvar button = Titanium.UI.createButton({\n    title:'click to open',\n    top:190,\n    left:30,\n    height:50,\n    width:250,\n    font:{fontSize:20}\n});\n\nbody.add(button);\nwin1.add(body);\n\nbutton.addEventListener('click', function(){\n    win3.open();\n    });\n\nvar win3 = Titanium.UI.createWindow({\n    title: 'Window 3',\n    name: 'Window 3',\n    backgroundColor: '#C4D5DA',\n    fullscreen: false,\n    animate: ({opacity: 0,duration: 300 }),\n    url: 'win3.js'\n    });\n
\n

win3.js

\n
\n\nvar win3 = Titanium.UI.currentWindow;\n\nvar body = Titanium.UI.createScrollView({\n    contentWidth:Titanium.Platform.displayCaps.platformWidth,contentHeight:500,\n    right:0,left:0,top:60,bottom:50,width:'auto',height:'auto',\n    showHorizontalScrollIndicator:false,showVerticalScrollIndicator:false});\n\nwin3.add(body)\n\nvar button = Titanium.UI.createButton({\n    title:'click to close',\n    top:190,\n    left:30,\n    height:50,\n    width:250,\n    font:{fontSize:20}\n});\n\nbody.add(button);\n\nbutton.addEventListener('click', function(){\n\n    win3.close();\n    });\n
{html}", "updateAuthor": { "name": "pete", "key": "pete", "displayName": "pete", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:30:46.000+0000", "updated": "2011-04-15T03:30:46.000+0000" }, { "id": "410974", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-09T23:18:23.000+0000", "updated": "2017-03-09T23:18:23.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }