Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2648] Android options menu hangs/crashes

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionInvalid
Resolution Date2011-04-15T03:25:49.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M03
ComponentsAndroid
Labelsandroid, defect, release-1.6.0
ReporterMatt Schmulen
AssigneeDon Thorp
Created2011-04-15T03:25:48.000+0000
Updated2017-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');
});



};

Comments

  1. Dawson Toth 2011-04-15

    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.

  2. Lee Morris 2017-03-02

    Closing as invalid.

JSON Source