{ "id": "106463", "key": "AC-2521", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "12217", "key": "AC", "name": "Appcelerator - INBOX", "projectCategory": { "id": "10000", "description": "", "name": "Customer Service" } }, "resolution": { "id": "8", "description": "", "name": "Needs more info" }, "resolutiondate": "2013-05-07T21:34:27.000+0000", "created": "2012-12-13T10:28:37.000+0000", "labels": [ "android" ], "versions": [], "issuelinks": [], "assignee": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "updated": "2016-03-08T07:41:35.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": "14548", "name": "Titanium SDK & CLI", "description": "Please enter tickets related to the MobileSDK here." } ], "description": "Hi,\r\nI'm using the new Titanium version, that adds Android's ActionBar support. I have a refresh button as Action, and I'd like to display an ActivityIndicator where the user presses it, while the view is being refreshed.\r\n\r\nHere's a very simple piece of code:\r\n\r\n{code}\r\nvar activity = win.activity;\r\n\tactivity.onCreateOptionsMenu = function(e) {\r\n\tvar menu = e.menu;\r\n\tvar refresh = menu.add({\r\n\t\ttitle: 'Refresh',\r\n\t\ticon: Titanium.App.Android.R.drawable.ic_menu_refresh,\r\n\t\tshowAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS\r\n\t});\r\n\trefresh.addEventListener('click', function() {\r\n\t\tvar activityIndicator = Ti.UI.createActivityIndicator({\r\n\t\t\tcolor: 'white',\r\n\t\t\tfont: {\r\n\t\t\t\t fontFamily: 'Droid Sans',\r\n\t\t\t\t fontSize: 26,\r\n\t\t\t\t fontWeight: 'bold'\r\n\t\t\t},\r\n\t\t\tstyle: Ti.UI.ActivityIndicatorStyle.PLAIN,\r\n\t\t});\r\n\t\tthis.setActionView(activityIndicator);\r\n\t});\r\n{code}\r\n\r\nI end up with a Ti Runtime Error, as shown in the attachment. \r\n\r\nThanks for your help guys!\r\n\r\nEDIT: sorry, should be moved to the TIMOB project. Can't figure out how to do it myself though", "attachment": [ { "id": "34144", "filename": "setActionView_error.png", "author": { "name": "tkeunebr", "key": "tkeunebr", "displayName": "Thomas Keunebroek", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-12-13T10:28:37.000+0000", "size": 46637, "mimeType": "image/png" } ], "flagged": false, "summary": "ActionBar.setActionView() not executed in the UI Thread", "creator": { "name": "tkeunebr", "key": "tkeunebr", "displayName": "Thomas Keunebroek", "active": true, "timeZone": "Europe/Berlin" }, "subtasks": [], "reporter": { "name": "tkeunebr", "key": "tkeunebr", "displayName": "Thomas Keunebroek", "active": true, "timeZone": "Europe/Berlin" }, "environment": "Titanium v3.0 (latest continuous build)", "comment": { "comments": [ { "id": "250645", "author": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Thomas,\n\nThanks for bringing this to our attention. In order for a community ticket (TC) to be moved to Mobile it has to be first verified, this is why you cannot move it yourself. As for your ticket, would you mind providing a runnable test case that shows the behavior. Having an app.js that can be easily copied and pasted into a project that can clearly show the bug allows for a speedy review and transition to Ti-Mobile. Once the test case is provided I will gladly take a look at it. For future reference:\nhttps://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report\nThanks for your cooperation,\nCarter", "updateAuthor": { "name": "clathrop", "key": "clathrop", "displayName": "Carter Lathrop", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-05-07T21:34:08.000+0000", "updated": "2013-05-07T21:34:08.000+0000" }, { "id": "283537", "author": { "name": "mrahman", "key": "mrahman", "displayName": "Mostafizur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\n\r\nWe tested this issue with the test code below. We can’t reproduce this issue in Ti SDK 3.1.3GA. Please install the latest SDK and test your app. If you continue to get error, please send us a test case with steps to reproduce. \r\n\r\nh5. Testing Environment:\r\nTi CLI 3.3.0\r\nTitanium SDK: 3.1.3 and later \r\nAndroid SDK: 4.2.2 \r\n\r\nh5. Test Code\r\n\r\napp.js\r\n{code}\r\nvar win = Ti.UI.createWindow({\r\n\tnavBarHidden : false,\r\n\ttitle : 'Action Bar',\r\n\tbackgroundColor : '#000'\r\n\r\n});\r\n\r\n// var activity = win.activity;\r\nwin.activity.onCreateOptionsMenu = function(e) {\r\n\tvar menu = e.menu;\r\n\tvar refresh = menu.add({\r\n\t\ttitle : 'Refresh',\r\n\t\tshowAsAction : Ti.Android.SHOW_AS_ACTION_ALWAYS\r\n\t});\r\n\r\n\trefresh.addEventListener('click', function() {\r\n\t\tvar activityIndicator = Ti.UI.createActivityIndicator({\r\n\t\t\tcolor : 'white',\r\n\t\t\tfont : {\r\n\t\t\t\tfontSize : 26,\r\n\t\t\t\tfontWeight : 'bold'\r\n\t\t\t},\r\n\t\t\tstyle : Ti.UI.ActivityIndicatorStyle.DARK,\r\n\t\t});\r\n\t\tthis.setActionView(activityIndicator);\r\n\t});\r\n\r\n};\r\n\r\nwin.open(); \r\n\r\n{code}\r\n\r\n\r\ntiapp.xml\r\n\r\n{code}\r\n \r\n 16\r\n \r\n \r\n \r\n \r\n\r\n{code}\r\n\r\n\r\nh5. Steps to Test\r\n\r\n1. Create a sample Project\r\n2. Update app.js file with my test code\r\n3. Update tiapp.xml file with above code \r\n4. And run this project with testing environment\r\n\r\nThanks ", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-12-10T14:13:45.000+0000", "updated": "2013-12-18T06:16:36.000+0000" }, { "id": "288781", "author": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing since the issue is not reproducible and the reporter has not got back to us with any further updated comments.", "updateAuthor": { "name": "shossain", "key": "shossain", "displayName": "Shak Hossain", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2014-01-20T05:30:17.000+0000", "updated": "2014-01-20T05:30:17.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }