[TIMOB-2648] Android options menu hangs/crashes
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2011-04-15T03:25:49.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Release 1.6.0 M03 |
Components | Android |
Labels | android, defect, release-1.6.0 |
Reporter | Matt Schmulen |
Assignee | Don Thorp |
Created | 2011-04-15T03:25:48.000+0000 |
Updated | 2017-03-02T18:20:17.000+0000 |
Description
Android options menu hangs/crashes
tested Ti 1.5.1 Android sim 2.1API's
refrence HelpDesk ticket
http://developer.appcelerator.com/helpdesk/view/61351">http://developer.appcelerator.com/helpdesk/view/61351
app.js
var tabGroup = Titanium.UI.createTabGroup();
var win1 = Titanium.UI.createWindow({
url: 'main/menu.js',
title:'Tab 1'
}); var tab1 = Titanium.UI.createTab({
icon:'KS_nav_views.png',
title:'Tab 1',
window:win1
});
tabGroup.addTab(tab1);
tabGroup.open();
menu.js
var win = Ti.UI.currentWindow;
var activity = Ti.Android.currentActivity;
var menu = null;
var item1 = null;
var l1 = Ti.UI.createLabel({
color : 'white',
text : ' YACK ',
left : 10, top : 10, height : 80, right : 10
}); win.add(l1);
Titanium.API.info('create activity'); activity.onCreateOptionsMenu = function(e){
menu = e.menu;
item1 = menu.add({title: 'PhotoGallery'});
//item1.setIcon("KS_nav_views.png");
item1.AddEventListener('click', function() {
Titanium.API.info('gotoGallery');
});
};
Matt,
Your (and the client's) code calls "AddEventListener" with a capital A, which doesn't exist. If you dig into the Trace level log, you'll see that it is hanging because it hit an exception when it is creating the options menu.
Fix that, and everything works. This bug is invalid.
Closing as invalid.