{ "id": "114705", "key": "TIMOB-14216", "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": null, "resolutiondate": null, "created": "2013-05-21T15:50:22.000+0000", "priority": { "name": "Low", "id": "4" }, "labels": [ "android", "holo", "navbarhidden", "setDisplayHomeAsUp" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" } ], "issuelinks": [ { "id": "37454", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "inwardIssue": { "id": "130114", "key": "AC-1643", "fields": { "summary": "Android: Crash with displayHomeAsUp and navBarHidden", "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" } }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } }, { "id": "28951", "type": { "id": "10003", "name": "Relates", "inward": "relates to", "outward": "relates to" }, "outwardIssue": { "id": "114700", "key": "TIMOB-14215", "fields": { "summary": "Android: activity.actionBar incompatible with navBarHidden:true", "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": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "updated": "2016-06-30T04:37:01.000+0000", "status": { "description": "The issue is open and ready for the assignee to start work on it.", "name": "Open", "id": "1", "statusCategory": { "id": 2, "key": "new", "colorName": "blue-gray", "name": "To Do" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "h1. The issue\r\n\r\nIt is not possible to call *setDisplayHomeAsUp* on the activity of a window with the *navBarHidden* property set to *true*. Otherwise, we get this error :\r\n\r\n{code}\r\n05-21 15:36:54.035: E/TiApplication(21464): (main) [163,163] Sending event: exception on thread: main msg:java.lang.NullPointerException; Titanium 3.1.0,2013/04/15 18:46,57634ef\r\n05-21 15:36:54.035: E/TiApplication(21464): java.lang.NullPointerException\r\n05-21 15:36:54.035: E/TiApplication(21464): \tat org.appcelerator.titanium.proxy.ActionBarProxy.handlesetDisplayHomeAsUp(ActionBarProxy.java:178)\r\n05-21 15:36:54.035: E/TiApplication(21464): \tat org.appcelerator.titanium.proxy.ActionBarProxy.handleMessage(ActionBarProxy.java:201)\r\n05-21 15:36:54.035: E/TiApplication(21464): \tat android.os.Handler.dispatchMessage(Handler.java:95)\r\n05-21 15:36:54.035: E/TiApplication(21464): \tat android.os.Looper.loop(Looper.java:137)\r\n05-21 15:36:54.035: E/TiApplication(21464): \tat android.app.ActivityThread.main(ActivityThread.java:4507)\r\n05-21 15:36:54.035: E/TiApplication(21464): \tat java.lang.reflect.Method.invokeNative(Native Method)\r\n05-21 15:36:54.035: E/TiApplication(21464): \tat java.lang.reflect.Method.invoke(Method.java:511)\r\n05-21 15:36:54.035: E/TiApplication(21464): \tat com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:790)\r\n05-21 15:36:54.035: E/TiApplication(21464): \tat com.android.internal.os.ZygoteInit.main(ZygoteInit.java:557)\r\n05-21 15:36:54.035: E/TiApplication(21464): \tat dalvik.system.NativeStart.main(Native Method)\r\n05-21 15:36:54.045: E/AndroidRuntime(21464): FATAL EXCEPTION: main\r\n{code}\r\n\r\nh1. Code to reproduce\r\n\r\napp.js :\r\n{code:javascript}\r\nfunction openNewWindow() {\r\n\tvar newWin = Ti.UI.createWindow({navBarHidden: true, backgroundColor: '#0F0'});\r\n\r\n\tnewWin.addEventListener(\"open\", function() {\r\n\t\tvar newActionBar = this.activity.actionBar;\r\n\t\tif (newActionBar) {\r\n\t\t\tnewActionBar.setDisplayHomeAsUp(true);\r\n\t\t}\r\n\t});\r\n\r\n\tnewWin.open();\r\n}\r\n\r\n(function() {\r\n\tvar win = Ti.UI.createWindow({backgroundColor: '#F00'});\r\n\twin.addEventListener(\"open\", openNewWindow);\r\n\r\n\twin.open();\r\n})();\r\n{code}\r\n\r\ntiapp.xml :\r\n{code:xml}\r\n\r\n\r\n com.tab.test\r\n TabTest\r\n 1.0\r\n johndoe\r\n http://\r\n not specified\r\n not specified\r\n appicon.png\r\n false\r\n false\r\n default\r\n false\r\n false\r\n false\r\n false\r\n e96a483e-41b2-4212-b78a-910612e01548\r\n system\r\n \r\n \r\n Ti.UI.PORTRAIT\r\n \r\n \r\n Ti.UI.PORTRAIT\r\n Ti.UI.UPSIDE_PORTRAIT\r\n Ti.UI.LANDSCAPE_LEFT\r\n Ti.UI.LANDSCAPE_RIGHT\r\n \r\n \r\n \r\n 17\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 \r\n \r\n \r\n \r\n \r\n \r\n false\r\n true\r\n false\r\n false\r\n false\r\n \r\n 3.1.0.GA\r\n\r\n{code}\r\n\r\n\r\nIf we set navBarHidden to false, the app will work :\r\n\r\n{code:javascript}\r\n\tvar newWin = Ti.UI.createWindow({navBarHidden: false, backgroundColor: '#0F0'});\r\n{code}\r\n\r\ninstead of\r\n\r\n{code:javascript}\r\n\tvar newWin = Ti.UI.createWindow({navBarHidden: true, backgroundColor: '#0F0'});\r\n{code}\r\n\r\nh1. Devices used\r\n\r\nThis problem is only reproducible on devices using *Holo*.\r\nI have tested on these devices :\r\n\r\n- Samsung S2 (GT-I9100P), android 4.0.3 -> *crash* (supports Holo)\r\n- Nexus S, android 4.1.2 -> *crash* (supports Holo)\r\n- Samsung S3 (GT-I93000), android 4.1.2 -> *crash* (supports Holo)\r\n- HTC Desire HD A9191, android 2.2 -> *ok* (does not supports Holo)\r\n- Samsung GT-S5830, android 2.3.3 -> *ok* (does not support Holo)\r\n- HTC Wildfire A3333, android 2.2.1 -> *ok* (does not support Holo)", "attachment": [], "flagged": false, "summary": "Android: setDisplayHomeAsUp doesn't work on a window with the navBarHidden property set to true", "creator": { "name": "romain.salles", "key": "romain.salles", "displayName": "Romain Salles", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "romain.salles", "key": "romain.salles", "displayName": "Romain Salles", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium API : 3.1.0.GA", "comment": { "comments": [ { "id": "253104", "author": { "name": "romain.salles", "key": "romain.salles", "displayName": "Romain Salles", "active": true, "timeZone": "Europe/Berlin" }, "updateAuthor": { "name": "romain.salles", "key": "romain.salles", "displayName": "Romain Salles", "active": true, "timeZone": "Europe/Berlin" }, "created": "2013-05-21T15:51:46.000+0000", "updated": "2013-05-21T15:51:46.000+0000" }, { "id": "303982", "author": { "name": "mrlundis", "key": "mrlundis", "displayName": "Jonatan Lundin", "active": true, "timeZone": "Europe/Berlin" }, "body": "Trying to set displayHomeAsUp will trigger the crash when the ActionBarProxy tries to access the underlying Activity's ActionBar. Checking for existence (like in the fix for TIMOB-14215) would fix this. \r\nhttps://github.com/appcelerator/titanium_mobile/blob/3_2_X/android/titanium/src/java/org/appcelerator/titanium/proxy/ActionBarProxy.java#L323\r\n\r\nReading further along in the code though, it appears like the same issue can be triggered by trying to add an event listener/setOnHomeIconItemSelected-callback to the home button as well, if the onPropertyChanged()-method gets called directly on the main thread. \r\n\r\nhttps://github.com/appcelerator/titanium_mobile/blob/3_2_X/android/titanium/src/java/org/appcelerator/titanium/proxy/ActionBarProxy.java#L337", "updateAuthor": { "name": "mrlundis", "key": "mrlundis", "displayName": "Jonatan Lundin", "active": true, "timeZone": "Europe/Berlin" }, "created": "2014-05-08T07:12:55.000+0000", "updated": "2014-05-08T07:12:55.000+0000" }, { "id": "304023", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FYI", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-05-08T15:55:55.000+0000", "updated": "2014-05-08T15:55:55.000+0000" } ], "maxResults": 3, "total": 3, "startAt": 0 } } }