{ "id": "118721", "key": "TIMOB-14913", "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": [ { "id": "15646", "description": "2013 Sprint 18", "name": "2013 Sprint 18", "archived": true, "released": true, "releaseDate": "2013-09-06" }, { "id": "15690", "description": "2013 Sprint 18 API", "name": "2013 Sprint 18 API", "archived": true, "released": true, "releaseDate": "2013-09-06" }, { "id": "15593", "description": "Release 3.1.3", "name": "Release 3.1.3", "archived": true, "released": true, "releaseDate": "2013-09-18" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-08-22T18:22:51.000+0000", "created": "2013-08-18T22:17:02.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "3.1.2", "actionbar", "activity", "android", "qe-testadded", "regression", "window" ], "versions": [], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-09-04T10:23:06.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": "Apparently with SDK 3.1.2.GA, Titanium thinks a lightweight window has an associated activity and action bar. In SDK 3.1.1.GA, window.getActivity() returns null for lightweight windows, but not in 3.1.2.GA\r\n\r\nindex.xml:\r\n{code}\r\n\r\n\t\r\n\t\r\n\t\t\r\n\t\r\n\r\n{code}\r\n\r\nindex.js:\r\n{code}\r\nfunction homeIconClicked() {\r\n\talert('clicked');\r\n}\r\n\r\n$.win1.addEventListener('open', function() {\r\n\tif (OS_ANDROID) {\r\n\t\tvar activity = $.win1.getActivity();\r\n\t\tif (!activity){\r\n\t\t\talert('no activity for this window');\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tvar actionBar = activity.actionBar;\r\n\t\tif (actionBar){\r\n\t\t\tactionBar.title = 'Window 1';\r\n\t\t\tactionBar.displayHomeAsUp = true;\r\n\t\t\tactionBar.onHomeIconItemSelected = homeIconClicked;\r\n\t\t} else {\r\n\t\t\talert('no action bar');\r\n\t\t}\r\n\t}\t\r\n});\r\n$.win1.open();\r\n{code}\r\n\r\nsnippet from tiapp.xml:\r\n{code}\r\n\r\n 17\r\n \r\n \r\n \r\n\r\n{code}\r\n", "attachment": [], "flagged": false, "summary": "Android: SDK 3.1.2 heavyweight/lightweight window confusion", "creator": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "subtasks": [], "reporter": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "environment": "SDK 3.1.2.GA, Android 4.1.2, Nexus S", "comment": { "comments": [ { "id": "267376", "author": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "body": "According to the release notes, TIMOB-13796 was addressed in 3.1.2, which is supposed to have made all Android windows heavyweight. However, I can reproduce your crash using your sample. I can solve the crash by forcing the window to be heavyweight (with navBarHidden or similar set as a window property)", "updateAuthor": { "name": "skypanther", "key": "skypanther", "displayName": "Tim Poulsen", "active": true, "timeZone": "America/New_York" }, "created": "2013-08-20T19:47:29.000+0000", "updated": "2013-08-20T19:47:29.000+0000" }, { "id": "267384", "author": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "body": "Looking through the code, 3.1.2 does not make all windows heavyweight:\r\nLook at postOnCreate in TiApplication.java - USE_LEGACY_WINDOW = true;", "updateAuthor": { "name": "mokesmokes", "key": "mokesmokes", "displayName": "Mark Mokryn", "active": true, "timeZone": "Asia/Jerusalem" }, "created": "2013-08-20T20:20:30.000+0000", "updated": "2013-08-20T20:21:05.000+0000" }, { "id": "267432", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "For 3.1.2, lightweight windows are still there. We will deprecate LW windows in 3.2.0.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-21T00:36:54.000+0000", "updated": "2013-08-21T00:36:54.000+0000" }, { "id": "267434", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Test case:\n{code}\n-------------------app.js-------------------------\nvar win = Ti.UI.createWindow({\n\tbackgroundColor: 'yellow',\n\turl: 'windowURL.js'\n});\n\nwin.addEventListener('open', function(){\n\tvar activity = win.getActivity();\n\tTi.API.info(\"********************** activity = \" + activity);\n\tif (!activity) {\n\t\talert(\"no activity for window\");\n\t}\n})\n\nwin.open();\n\n--------------------windowURL.js-------------------\nvar win = Ti.UI.currentWindow;\n\nsetTimeout(function(){\n\twin.backgroundColor = 'red';\n}, 1000);\n\n{code}\nFor FR, please add {code}true{code} to the tiapp.xml and run the above test case. Should see an alert and the window background color changes from yellow to red. \nPlease also test KS->Base UI->Menu(Android).", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-21T00:58:23.000+0000", "updated": "2013-08-21T00:58:23.000+0000" }, { "id": "267435", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/4590", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-21T01:09:23.000+0000", "updated": "2013-08-21T01:09:23.000+0000" }, { "id": "267632", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "3_1_X PR: https://github.com/appcelerator/titanium_mobile/pull/4597", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-22T17:15:03.000+0000", "updated": "2013-08-22T17:15:03.000+0000" }, { "id": "267801", "author": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified Environment:\r\nStudio: 3.1.3.201308201707\r\nSdk: 3.1.3.v20130822140128\r\nacs:1.0.6\r\nalloy:1.2.1-cr\r\ntitanium:3.1.2\r\nOS: OSX 10.8.4\r\nDevices:Android Nexus 7(4.3),Samsung Duos(2.3.6),Nexus 7(4.2.1)\r\n\r\n\r\nUsed the code given above for alloy project it was reproducible on 3.1.2.GA but now it is resolved.\r\nwindow.getActivity() returns null for lightweight windows in 3.1.3.v20130822140128. \r\nbut in 3.1.2.GA window.getActivity() returns null for lightweight windows \"I/TiAPI(15727): ***********{\"bubbleParent\":true,\"actionBar\":{\"bubbleParent\":true,\"title\":null}}\".\r\n\r\n\r\nIssue is resolved now as window.getActivity() returns null for lightweight windows using 3.1.3.v20130822140128 sdk.\r\n\r\nThus closing as fixed.\r\n ", "updateAuthor": { "name": "pagarwal", "key": "pagarwal", "displayName": "Priya Agarwal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-08-23T09:58:09.000+0000", "updated": "2013-08-23T09:58:09.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }