That didn't help, but i've been playing with the code and actually
found my problem.
I have an
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode == KeyEvent.KEYCODE_BACK){
//do stuff
}
I just commented it out and the menu displays perfectly... So I guess
that method is stopping it detecting my menu key press.
I just added in a line to detect the menu button being pressed and to
open the options menu and it works perfectly
Thank you very much for your assistance :)
On Aug 2, 10:47 pm, Mark Murphy <[email protected]> wrote:
> [email protected] wrote:
> > @Override
> > public boolean onCreateOptionsMenu(Menu menu)
> > {
> > super.onCreateOptionsMenu(menu);
> > MenuItem item = menu.add(0,1,0, "Set Fav Dir");
> > MenuItem item = menu.add(0,2,0,"Change Layout");
> > return true;
> > }
>
> Try:
>
> @Override
> public boolean onCreateOptionsMenu(Menu menu) {
> menu.add(0,1,0, "Set Fav Dir");
> menu.add(0,2,0,"Change Layout");
>
> return(super.onCreateOptionsMenu(menu);
>
> }
>
> and see if that helps.
>
> Or, define your menus in XML and use MenuInflater.
>
> --
> Mark Murphy (a Commons
> Guy)http://commonsware.com|http://twitter.com/commonsguy
>
> Android Development Wiki:http://wiki.andmob.org
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---