Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-2885] Android: Menu icons don't accept app:// paths

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T02:00:21.000+0000
Affected Version/sn/a
Fix Version/sRelease 1.6.0 M06
ComponentsAndroid
Labelsandroid, defect, release-1.6.0, reported-1.6.0, rplist
ReporterDawson Toth
AssigneeDon Thorp
Created2011-04-15T03:32:02.000+0000
Updated2011-04-17T02:00:21.000+0000

Description

Problem

app:// paths do not work for options menu icon paths.

Sample Code

app.js creates a heavyweight window pointing to mainwindow.js:

Titanium.UI.createWindow({

navBarHidden: true,
backgroundColor: '#fff',
url: 'mainwindow.js',
exitOnClose: true



}).open();

mainwindow.js makes a very simple options menu, setting the icon to one of the icons included by default in new projects:

Titanium.Android.currentActivity.onCreateOptionsMenu = function(e) {

e.menu
        .add({title: 'Menu Item '})
        .setIcon('app://KS_nav_ui.png');



};

Trace Level Log

I did not see anything relevant in the log, but it is attached anyway.

Tested On

Titanium Mobile 1.6.0 (Jan 19, 2011)
BROKEN on Android Simulator 2.2

Associated Helpdesk Ticket

http://developer.appcelerator.com/helpdesk/view/60941">http://developer.appcelerator.com/helpdesk/view/60941

Attachments

FileDateSize
menuiconswithapppathtrace.rtf2011-04-15T03:32:02.000+000030329

Comments

  1. Don Thorp 2011-04-15

    Now that the menu support is in the initial context, the test code can be. I set the icon in onPrepareOptionsMenu to make debugging easier. The effect is the same.

       
       var mi = null;
       Titanium.Android.currentActivity.onCreateOptionsMenu = function(e) {
           mi = e.menu.add({title: 'Menu Item '});
       };
       Titanium.Android.currentActivity.onPrepareOptionsMenu = function(e) {
           mi.setIcon('app://KS_nav_ui.png');
       }
       
  2. Don Thorp 2011-04-15

    should be in M06

  3. Don Thorp 2011-04-15

    Commit hook didn't fire https://github.com/appcelerator/titanium_mobile/commit/4f15971134987632d7f76585fc526b0f21dc6406"> commit

  4. Marshall Culpepper 2011-04-15

    verified working on Nexus S / 2.3.2

JSON Source