[AC-2521] ActionBar.setActionView() not executed in the UI Thread
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Needs more info |
Resolution Date | 2013-05-07T21:34:27.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | android |
Reporter | Thomas Keunebroek |
Assignee | Shak Hossain |
Created | 2012-12-13T10:28:37.000+0000 |
Updated | 2016-03-08T07:41:35.000+0000 |
Description
Hi,
I'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.
Here's a very simple piece of code:
var activity = win.activity;
activity.onCreateOptionsMenu = function(e) {
var menu = e.menu;
var refresh = menu.add({
title: 'Refresh',
icon: Titanium.App.Android.R.drawable.ic_menu_refresh,
showAsAction: Ti.Android.SHOW_AS_ACTION_ALWAYS
});
refresh.addEventListener('click', function() {
var activityIndicator = Ti.UI.createActivityIndicator({
color: 'white',
font: {
fontFamily: 'Droid Sans',
fontSize: 26,
fontWeight: 'bold'
},
style: Ti.UI.ActivityIndicatorStyle.PLAIN,
});
this.setActionView(activityIndicator);
});
I end up with a Ti Runtime Error, as shown in the attachment.
Thanks for your help guys!
EDIT: sorry, should be moved to the TIMOB project. Can't figure out how to do it myself though
Attachments
File | Date | Size |
---|---|---|
setActionView_error.png | 2012-12-13T10:28:37.000+0000 | 46637 |
Thomas, Thanks 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: https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report Thanks for your cooperation, Carter
Hello, We 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.
Testing Environment:
Ti CLI 3.3.0 Titanium SDK: 3.1.3 and later Android SDK: 4.2.2Test Code
app.jstiapp.xml
Steps to Test
1. Create a sample Project 2. Update app.js file with my test code 3. Update tiapp.xml file with above code 4. And run this project with testing environment ThanksClosing since the issue is not reproducible and the reporter has not got back to us with any further updated comments.