Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9127465
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T07:17:19+00:00 2026-06-17T07:17:19+00:00

I am doing menu item. But i am not able to view the menu

  • 0

I am doing menu item. But i am not able to view the menu item in the screen. Can anybody tell me what is getting wrong or what other need to be added to get the code working. I have got totally stuck.

          package com.example.androiddemo;

          import android.app.Activity;
          import android.os.Bundle;
          import android.view.Menu;
          import android.view.MenuInflater;

           public class MenuItem extends Activity {

     @Override
         protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
                setContentView(R.menu.menupage);
      }

    public boolean  onCreateOptionsMenu(Menu menu){
        MenuInflater inflater = getMenuInflater();
            inflater.inflate(R.menu.menupage, menu);
            return true;
       }
        }

xml

   <?xml version="1.0" encoding="utf-8"?>
   <menu xmlns:android="http://schemas.android.com/apk/res/android">
   <item
        android:id="@+id/about"
        android:icon="@drawable/images"
        android:title="About"
        android:showAsAction="ifRoom"
      />
   <item
        android:id="@+id/setting"
        android:icon="@drawable/ic_launcher"
        android:title="App Setting"
        />
   </menu>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T07:17:20+00:00Added an answer on June 17, 2026 at 7:17 am

    Here you have to set your activity’s xml file.

    public void onCreate(Bundle savedInstanceState) {
            super.onCreate(savedInstanceState);
                    setContentView(R.layout.main); // Your activity's xml file.
          }
    
    public boolean  onCreateOptionsMenu(Menu menu){
            MenuInflater inflater = getMenuInflater();
                inflater.inflate(R.menu.menupage, menu); // Here you are setting the menu whatever options you want.
                return true;
           }
            }
    

    After running this, just press on menu, It should show your options. If not post back.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Here i wrote some code but not getting output.. Please tell me why is
Here I tried to make option menu, but menu is not displaying on screen,
I'm doing like this ..... but i'm not able succeed... For the check out
I am doing an horizontal dropdown menu. It looks like this : [menu1][menu2][menu3][menu4] But
I find my self doing this but not sure if this is the best
am not sure if I'm doing this right, but I'm trying to create a
I want to put a menu item on the action bar (just doing a
My application runs on Gingerbread. It can properly show action-bar menu-item in normal SherlockFragmentActivity
I need to execute script once user clicked my context menu item. So for
how would i got about doing something when hovering over a list item, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.