Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

onCreateOptionsMenu - Solved! #49

Closed
deckameron opened this issue Jan 29, 2014 · 1 comment
Closed

onCreateOptionsMenu - Solved! #49

deckameron opened this issue Jan 29, 2014 · 1 comment

Comments

@deckameron
Copy link

I need to create a menu button (3 dots) on the ActionBar, but is not working.
Do you have any suggestion? :-)

drawer.activity.onCreateOptionsMenu = function(e){
var menu = e.menu;
//Something nice
};

@deckameron
Copy link
Author

Nevermind! :-)

if(this.getActivity()) {

    this.getActivity().onCreateOptionsMenu = function(e){
        var menu = e.menu;

        var menuNoticias = menu.add({
            title : "Notícias",
            icon : "/images/news-50@2x.png",
            showAsAction : Ti.Android.SHOW_AS_ACTION_IF_ROOM
        });

        var menuItem1 = menu.add({ 
            title: "Assistir Depois",
            showAsAction : Ti.Android.SHOW_AS_ACTION_NEVER
        });

        var menuItem2 = menu.add({ 
            title: "Sugestões", 
            icon: '/menu_dots.png', 
            showAsAction : Ti.Android.SHOW_AS_ACTION_NEVER 
        });

        var menuItem3 = menu.add({ 
            title: "Não Receber Notificações",
            showAsAction : Ti.Android.SHOW_AS_ACTION_NEVER
        });
    };

}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant