Win a copy of Svelte and Sapper in Action this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Bear Bibeault
  • Junilu Lacar
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • salvin francis
  • Frits Walraven
Bartenders:
  • Scott Selikoff
  • Piet Souris
  • Carey Brown

Menu not displayed

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am trying to create a menu with three options but I can't watch it on the screen. I haven't errors, I only watch the bar on top of the screen with the title of the activivty.

Here is the code:

activity_main.xml



menusota.xml



MainActivity.java




Part of AndroidManifest.xml




How can I watch the menu?

Thanks.
 
Ranch Hand
Posts: 570
3
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If I understand your question correctly, you want something like pop up menu, right ?

First, you have to create one more menu, named create_menu.

Then replace your onCreateOptionsMenu with this



Inside create_menu, add this code



Change your MainActivity onOptionsItemSelected()


MainActivity

 
Alex Munozz
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for answering, but I don' want a pop up menu. The idea is to create three icons below the screen and when one of them is touched show the options.
 
Ranch Hand
Posts: 146
4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Should line 9 in the menu be:
 
Don't get me started about those stupid light bulbs.
    Bookmark Topic Watch Topic
  • New Topic