{ "id": "166572", "key": "TIMOB-24478", "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": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-03-20T22:20:21.000+0000", "created": "2017-03-12T23:46:10.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-20T22:20:21.000+0000", "status": { "description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.", "name": "Resolved", "id": "5", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "postlayout calls the linked function twice when the app starts for the first time. when the view/window called/loaded the second time, postlayout function gets called only once.\r\n\r\nThis is also the same with titanium.", "attachment": [ { "id": "61838", "filename": "bluewin.js", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-03-12T23:44:48.000+0000", "size": 787, "mimeType": "text/javascript" }, { "id": "61836", "filename": "bluewin.xml", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-03-12T23:44:56.000+0000", "size": 255, "mimeType": "text/xml" }, { "id": "61847", "filename": "index.js", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-03-14T02:43:36.000+0000", "size": 156, "mimeType": "text/javascript" }, { "id": "61839", "filename": "index.js", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-03-12T23:44:46.000+0000", "size": 989, "mimeType": "text/javascript" }, { "id": "61846", "filename": "index.xml", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-03-14T02:43:43.000+0000", "size": 192, "mimeType": "text/xml" }, { "id": "61837", "filename": "index.xml", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-03-12T23:44:53.000+0000", "size": 1646, "mimeType": "text/xml" }, { "id": "61845", "filename": "Screen Shot 2017-03-14 at 13.41.39.png", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-03-14T02:43:57.000+0000", "size": 136349, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: postlayout function is called twice when the app starts", "creator": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "subtasks": [], "reporter": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "environment": "Mac OSX, Sierra, Studio 4.8.1.201612050850", "closedSprints": [ { "id": 854, "state": "closed", "name": "2017 Sprint 06 SDK", "startDate": "2017-03-12T19:14:58.337Z", "endDate": "2017-03-26T19:14:00.000Z", "completeDate": "2017-03-26T22:01:15.828Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "411398", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Hey Ilay! This is iOS right? We need to build a single-file example to simplify the testing. Let me know if we can help with that, thx! \r\n\r\nAnd in addition to that: On Ti.UI.Window instances, you would rather choose the {{open}} or {{focus}} event that are specifically made for window lifetime-tracking. Anyway, the {{postlayout}} event should still only fire once.", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-13T10:42:38.000+0000", "updated": "2017-03-13T10:44:05.000+0000" }, { "id": "411399", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "body": "HI Hans,\r\n\r\nRan the app on Android simulator. Will send the single file tomorrow for testing.\r\n\r\nIs it any easier if I upload the file to github for future ?", "updateAuthor": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-03-13T10:45:44.000+0000", "updated": "2017-03-13T10:45:44.000+0000" }, { "id": "411400", "author": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "body": "Thanks, changed the title! Just a simple app.js attached to this ticket, inline as JS or linked via Github is fine. Assigning to [~gmathews] for now, thx! ", "updateAuthor": { "name": "hknoechel", "key": "hansknoechel", "displayName": "Hans Knöchel", "active": true, "timeZone": "Europe/Berlin" }, "created": "2017-03-13T10:55:50.000+0000", "updated": "2017-03-13T10:55:50.000+0000" }, { "id": "411808", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "body": "OK. Please find the single js & xml file, along with the console screengrab.\r\n\r\n", "updateAuthor": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-03-14T02:42:51.000+0000", "updated": "2017-03-14T02:42:51.000+0000" }, { "id": "411809", "author": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "body": "On load is called once, but the postlayout is called twice...", "updateAuthor": { "name": "isener", "key": "isener", "displayName": "ILAY SENER", "active": true, "timeZone": "Australia/Sydney" }, "created": "2017-03-14T02:44:12.000+0000", "updated": "2017-03-14T02:44:12.000+0000" }, { "id": "412067", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{code:js}\r\nvar win = Ti.UI.createWindow({backgroundColor: 'gray'});\r\n\r\nwin.addEventListener('open', function() {\r\n Ti.API.info('open event fired.');\r\n});\r\n\r\nwin.addEventListener('postlayout', function() {\r\n Ti.API.info('postlayout event fired.');\r\n});\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-14T13:22:46.000+0000", "updated": "2017-03-14T13:22:46.000+0000" }, { "id": "412086", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/8887", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-14T15:43:38.000+0000", "updated": "2017-03-14T15:43:38.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }