{ "id": "150588", "key": "ALOY-1327", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "11113", "key": "ALOY", "name": "Alloy", "projectCategory": { "id": "10400", "description": "Tools for developing applications", "name": "Tooling" } }, "fixVersions": [], "resolution": null, "resolutiondate": null, "created": "2015-08-20T23:56:47.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [], "versions": [ { "id": "17081", "name": "Release 5.2.0", "archived": false, "released": true, "releaseDate": "2016-02-23" } ], "issuelinks": [ { "id": "49902", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "153320", "key": "TIDOC-2376", "fields": { "summary": "Update Ti.Android.Menu Alloy sample", "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" } }, "priority": { "name": "Low", "id": "4" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "updated": "2019-04-04T01:13:43.000+0000", "status": { "description": "This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.", "name": "Reopened", "id": "4", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "13605", "name": "Models" } ], "description": "Refer to \"don't keep activities option\" [here|https://docs.appcelerator.com/platform/latest/#!/api/Titanium.Android.Activity]\r\n\r\nSo I test it with my app written in Alloy. Several issues. For example, action bar menu items are gone if the menu is defined only in Alloy markup. With Titanium Class, it seems fine.\r\n\r\nUsually people won't turn on \"Don't keep activities,\" but it's available under developer's options for us to simulate the scenario when the system destroys (due to low memory) and recreates our activities.\r\n\r\nI believe the problem is with Alloy. I just list one example issue. Please investigate.\r\n\r\nTest cases:\r\n\r\nClassic\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n fullscreen: true\r\n});\r\n\r\nvar activity = win.activity;\r\n\r\nactivity.onCreateOptionsMenu = function(e){\r\n var menu = e.menu;\r\n var menuItem = menu.add({\r\n title: \"Item 1\",\r\n icon: \"item1.png\",\r\n showAsAction: Ti.Android.SHOW_AS_ACTION_IF_ROOM\r\n });\r\n menuItem.addEventListener(\"click\", function(e) {\r\n Ti.API.debug(\"I was clicked\");\r\n });\r\n};\r\n\r\nwin.open();\r\n{code}\r\n\r\nAlloy\r\nindex.js\r\n{code}\r\nfunction doClick(e) {\r\n Ti.API.info(\"Menu item clicked: \" + e.source.title);\r\n}\r\n\r\n// Ensure menu is displayed\r\nfunction doOpen(e) {\r\n $.win.invalidateOptionsMenu();\r\n}\r\n{code}\r\n\r\nindex.xml\r\n{code}\r\n\r\n \r\n \r\n\r\n \r\n \r\n\r\n \r\n \r\n \r\n\r\n \r\n \r\n\r\n{code}", "attachment": [ { "id": "57907", "filename": "Screen Shot 2016-01-07 at 6.21.33 PM.png", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-01-08T02:30:46.000+0000", "size": 78010, "mimeType": "image/png" }, { "id": "57906", "filename": "Screen Shot 2016-01-07 at 6.22.21 PM.png", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-01-08T02:30:46.000+0000", "size": 62029, "mimeType": "image/png" } ], "flagged": false, "summary": "Android: Alloy not working well when activity recreated by system", "creator": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "SDK 4.1.0/Alloy 1.6.2/Android 5.0", "comment": { "comments": [ { "id": "365598", "author": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Like I said, there are several issues, but the root cause is the same. Use the menu sample as a start. See my updated description. Thanks.\r\n\r\n", "updateAuthor": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2015-10-02T01:17:35.000+0000", "updated": "2015-10-02T01:17:35.000+0000" }, { "id": "370149", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "I'm not able to reproduce the reported issue.\r\nAlso, the test app {{index.js}} should be updated as follows:\r\n{code}\r\n$.win.invalidateOptionsMenu(); // should be --> $.win.activity.invalidateOptionsMenu();\r\n{code}\r\n ", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2015-11-12T23:17:48.000+0000", "updated": "2015-11-12T23:17:48.000+0000" }, { "id": "374049", "author": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Can you please share with me how to test it? The issue is there, at least from my test. Thanks.", "updateAuthor": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-08T01:11:30.000+0000", "updated": "2016-01-08T01:11:30.000+0000" }, { "id": "374053", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "Reopen to upload screenshots", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-01-08T02:30:21.000+0000", "updated": "2016-01-08T02:30:21.000+0000" }, { "id": "374054", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "[~shawnlan], attached are what I get running the alloy test app you provided. \r\nPlease let me know if I have overlooked anything.", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-01-08T02:32:37.000+0000", "updated": "2016-01-08T02:32:37.000+0000" }, { "id": "374056", "author": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "To test \"Do Not Keep Activities:\" after launching the app, press \"Home\" (not Back) to put the app into background. Then bring the app to the foreground from launcher. See if this time the menu item is gone.\r\n\r\nMake sure you are using the Alloy example, not the Classic example. Thanks!", "updateAuthor": { "name": "shawnlan", "key": "shawnlan", "displayName": "Shawn Lan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-01-08T02:37:45.000+0000", "updated": "2016-01-08T02:37:45.000+0000" }, { "id": "374058", "author": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "body": "[~shawnlan], thanks for the clarification, I'll look into!", "updateAuthor": { "name": "fmiao", "key": "fmiao", "displayName": "Feon Sua Xin Miao", "active": true, "timeZone": "America/Vancouver" }, "created": "2016-01-08T02:49:08.000+0000", "updated": "2016-01-08T02:49:08.000+0000" } ], "maxResults": 11, "total": 11, "startAt": 0 } } }