{ "id": "169783", "key": "TIMOB-25382", "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": "17609", "description": "", "name": "Release 7.0.0", "archived": false, "released": true, "releaseDate": "2017-12-07" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2017-11-13T18:55:19.000+0000", "created": "2017-09-14T18:25:34.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "6.2.0", "android", "drawerlayout" ], "versions": [], "issuelinks": [], "assignee": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2018-06-11T14:15:25.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": "When using a DrawerLayout in an app that is not running with \r\n{{true}} it will raise a \"CalledFromWrongThreadException\" error:\r\n\r\n*Code*\r\n{code:javascript}\r\nvar win = Ti.UI.createWindow(),\r\n\tleftView = Ti.UI.createView({\r\n\t\tbackgroundColor: \"#333\",\r\n\t\tlayout: \"vertical\"\r\n\t}),\r\n\tcenterView = Ti.UI.createView({\r\n\t\tbackgroundColor: \"#fff\"\r\n\t}),\r\n\trightView = Ti.UI.createView({\r\n\t\tbackgroundColor: \"#333\"\r\n\t}),\r\n\tdrawer = Ti.UI.Android.createDrawerLayout({\r\n\t\tleftView: leftView,\r\n\t\tcenterView: centerView,\r\n\t\trightView: rightView\r\n\t}),\r\n\tbtn1 = Ti.UI.createButton({\r\n\t\ttop: 100,\r\n\t\ttitle: 'Left'\r\n\t}),\r\n\tbtn2 = Ti.UI.createButton({\r\n\t\ttop: 150,\r\n\t\ttitle: 'Right'\r\n\t});\r\n\r\nfor (var i = 0; i < 10; ++i) {\r\n\tvar lbl1 = Ti.UI.createLabel({\r\n\t\tcolor: \"#fff\",\r\n\t\ttext: \"Item\",\r\n\t\ttop: 10,\r\n\t\tbottom: 10,\r\n\t\theight: Ti.UI.SIZE\r\n\t});\r\n\tleftView.add(lbl1);\r\n}\r\n\r\nbtn2.addEventListener('click', function() {\r\n\tdrawer.toggleRight();\r\n});\r\nbtn1.addEventListener('click', function() {\r\n\tdrawer.toggleLeft();\r\n});\r\n\r\ncenterView.add(btn1);\r\ncenterView.add(btn2);\r\n\r\nwin.addEventListener('open', function() {\r\n\tvar activity = win.getActivity(),\r\n\t\tactionbar = activity.getActionBar();\r\n\r\n\tif (actionbar) {\r\n\t\tactionbar.displayHomeAsUp = true;\r\n\t\tactionbar.onHomeIconItemSelected = function() {\r\n\t\t\tdrawer.toggleLeft();\r\n\t\t};\r\n\t}\r\n\r\n});\r\n\r\nwin.add(drawer);\r\nwin.open();\r\n{code}\r\n\r\nKitchenSink Demo: https://github.com/appcelerator/kitchensink-v2/pull/14\r\n\r\n\r\n*Error:*\r\n{code}\r\n[WARN] W/System.err: android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.\r\n[WARN] W/System.err: at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:7107)\r\n[WARN] W/System.err: at android.view.ViewRootImpl.invalidateChildInParent(ViewRootImpl.java:1139)\r\n[WARN] W/System.err: at android.view.ViewGroup.invalidateChild(ViewGroup.java:5254)\r\n[WARN] W/System.err: at android.view.View.invalidateInternal(View.java:13669)\r\n[WARN] W/System.err: at android.view.View.invalidate(View.java:13633)\r\n[WARN] W/System.err: at android.view.View.invalidate(View.java:13617)\r\n[WARN] W/System.err: at android.support.v4.widget.DrawerLayout.openDrawer(DrawerLayout.java:1615)\r\n[WARN] W/System.err: at android.support.v4.widget.DrawerLayout.openDrawer(DrawerLayout.java:1641)\r\n[WARN] W/System.err: at android.support.v4.widget.DrawerLayout.openDrawer(DrawerLayout.java:1625)\r\n[WARN] W/System.err: at ti.modules.titanium.ui.widget.TiUIDrawerLayout.openLeft(TiUIDrawerLayout.java:193)\r\n[WARN] W/System.err: at ti.modules.titanium.ui.widget.TiUIDrawerLayout.toggleLeft(TiUIDrawerLayout.java:188)\r\n[WARN] W/System.err: at ti.modules.titanium.ui.android.DrawerLayoutProxy.toggleLeft(DrawerLayoutProxy.java:49)\r\n[WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.nativeInvoke(Native Method)\r\n[WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.callSync(V8Function.java:57)\r\n[WARN] W/System.err: at org.appcelerator.kroll.runtime.v8.V8Function.handleMessage(V8Function.java:82)\r\n[WARN] W/System.err: at android.os.Handler.dispatchMessage(Handler.java:98)\r\n[WARN] W/System.err: at android.os.Looper.loop(Looper.java:173)\r\n[WARN] W/System.err: at org.appcelerator.kroll.KrollRuntime$KrollRuntimeThread.run(KrollRuntime.java:118)\r\n{code}\r\n\r\n*Workaround*\r\n\r\nAdd {{true}} to tiapp.xml\r\n\r\n*Environment*\r\nTi SDK 6.2.0.GA\r\nAndroid 7", "attachment": [], "flagged": false, "summary": "Android: Wrong thread error in DrawerLayout when not running on main thread", "creator": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "michael", "key": "michael", "displayName": "Michael Gangolf", "active": true, "timeZone": "Europe/Berlin" }, "environment": null, "closedSprints": [ { "id": 963, "state": "closed", "name": "2017 Sprint 22 SDK", "startDate": "2017-10-22T21:43:59.523Z", "endDate": "2017-11-05T22:43:00.000Z", "completeDate": "2017-11-06T16:33:42.425Z", "originBoardId": 114 }, { "id": 968, "state": "closed", "name": "2017 Sprint 23 SDK", "startDate": "2017-11-05T16:37:25.071Z", "endDate": "2017-11-19T16:37:00.000Z", "completeDate": "2017-11-20T18:57:56.565Z", "originBoardId": 114 }, { "id": 959, "state": "closed", "name": "2017 Sprint 21 SDK", "startDate": "2017-10-08T20:38:15.130Z", "endDate": "2017-10-22T20:38:00.000Z", "completeDate": "2017-10-24T23:55:56.605Z", "originBoardId": 114 } ], "comment": { "comments": [ { "id": "428966", "author": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "body": "master: https://github.com/appcelerator/titanium_mobile/pull/9516", "updateAuthor": { "name": "gmathews", "key": "gmathews", "displayName": "Gary Mathews", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-10-11T21:06:12.000+0000", "updated": "2017-10-11T21:06:12.000+0000" }, { "id": "430440", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "FR Passed.\r\nWaiting for merge to get enabled.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-11T02:17:01.000+0000", "updated": "2017-11-11T02:17:01.000+0000" }, { "id": "430528", "author": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR Merged.", "updateAuthor": { "name": "lchoudhary", "key": "lchoudhary", "displayName": "Lokesh Choudhary", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-13T18:55:10.000+0000", "updated": "2017-11-13T18:55:10.000+0000" }, { "id": "430664", "author": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Changes are seen in SDK 7.0.0.v20171114202841.", "updateAuthor": { "name": "amukherjee", "key": "amukherjee", "displayName": "Abir Mukherjee", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-11-15T05:59:27.000+0000", "updated": "2017-11-15T05:59:27.000+0000" }, { "id": "438281", "author": { "name": "gduthieuw", "key": "gduthieuw", "displayName": "Guile", "active": true, "timeZone": "Europe/Berlin" }, "body": "I still have the problem with SDK7.1 and run on main thread false.\r\n\r\nI don't want to set it to true, because the last time I did it, there was a lot of buggy things.\r\n\r\nCan you describe the solution that was made, and how I can prevent this bug to occur ?\r\n\r\nThank you", "updateAuthor": { "name": "gduthieuw", "key": "gduthieuw", "displayName": "Guile", "active": true, "timeZone": "Europe/Berlin" }, "created": "2018-06-11T14:15:25.000+0000", "updated": "2018-06-11T14:15:25.000+0000" } ], "maxResults": 8, "total": 8, "startAt": 0 } } }