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

  • SEARCH
  • Home
  • 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 6989323
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T19:11:48+00:00 2026-05-27T19:11:48+00:00

i’m not really sure what i’m doing wrong. I am working on a 6

  • 0

i’m not really sure what i’m doing wrong. I am working on a 6 button menu. The buttons Display but do not call the activity, and i cant see any text displayed on the menu button. They appear Blank, Help Please!!

package com.cerealBarApps;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.Menu;
import android.view.MenuInflater;
import android.view.MenuItem;

public class FirstLoginActivity extends Activity {

    protected void onCreate(Bundle Ebenezersbundle)

    {
        super.onCreate(Ebenezersbundle);
        setContentView(R.layout.testlayout);
    }

    public boolean onCreateOptionsMenu(Menu menu) {
        super.onCreateOptionsMenu(menu);
        MenuInflater awesome = getMenuInflater();
        awesome.inflate(R.menu.main_menu, menu);
        return true;
    }

    /*
     * Intent nextScreen = new Intent(getApplicationContext(),
     * AllFaculty.class); // Sending data to another Activity
     * startActivity(nextScreen);
     */
    public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case 1:
            Intent intent1 = new Intent(this, SMS.class);
            startActivity(intent1);
            break;
        case 2:
            Intent intent2 = new Intent(this, MenuRecieved.class);
            startActivity(intent2);
            break;
        case 3:
            Intent intent3 = new Intent(this, MenuSent.class);
            startActivity(intent3);
        case 4:
            Intent intent4 = new Intent(this, MenuSettings.class);
            startActivity(intent4);
        case 5:
            Intent intent5 = new Intent(this, MenuExit.class);
            startActivity(intent5);

        default:
            break;
        }
        return super.onOptionsItemSelected(item);
    }
}

Menu XML:

<?xml version="1.0" encoding="UTF-8"?>
<menu xmlns:android="xmlns:android= http:/schemas.android.com/apk/res/android" >

    <item
        android:id="@+id/menuMenu"
        android:alphabeticShortcut="m"
        android:title="MenuTest"/>
    <item
        android:id="@+id/menuNewMessage"
        android:alphabeticShortcut="n"
        android:title="New Message"/>

    <item
        android:id="@+id/menuSent"
        android:alphabeticShortcut="s"
        android:title="Sent"/>

    <item
        android:id="@+id/menuRecieved"
        android:alphabeticShortcut="r"
        android:title="Recieved"/>

    <item
        android:id="@+id/menuSettings"
        android:alphabeticShortcut="s"
        android:title="Settings"/>

    <item
        android:id="@+id/menuExit"
        android:alphabeticShortcut="e"
        android:title="Exit"/>

</menu

Code:

public boolean onOptionsItemSelected(MenuItem item) {
        switch (item.getItemId()) {
        case R.id.menuNewMessage:
            startActivity(new Intent(getApplicationContext(), SMS.class));
            return true;
        case R.id.menuSent:
            startActivity(new Intent("com.cerealBarApps"));
            return true;
        case R.id.menuRecieved:
            startActivity(new Intent("com.cerealBarApps"));
            return true;
        case R.id.menuSettings:
            startActivity(new Intent("com.cerealBarApps"));
            return true;
        case R.id.menuExit:
            startActivity(new Intent("com.cerealBarApps"));
            return true;
        }
        return false;
    }
}
  • 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-05-27T19:11:49+00:00Added an answer on May 27, 2026 at 7:11 pm

    Hey guys i figured it out, it was because i didnt do an onCreateOptionsMenu method. Thanks gusy for the help

    public boolean onCreateOptionsMenu(Menu menu) {
                menu.add(0, menuNewMessage, 0, "New Message");
                menu.add(0, menuSent, 0, "Outbox");
                menu.add(0, menuRecieved, 0, "Inbox");
                menu.add(0, menuSettings, 0, "Settings");
                menu.add(0, menuExit, 0, "Exit");
                return super.onCreateOptionsMenu(menu);
            }
    
            public boolean onOptionsItemSelected(MenuItem item) {
                switch (item.getItemId()) {
                case menuNewMessage:
                    startActivity(new Intent(getApplicationContext(), SMS.class));
                    break;
                case menuSent:
                    startActivity(new Intent(getApplicationContext(), MenuSent.class));
                    break;
                case menuRecieved:
                    startActivity(new Intent(getApplicationContext(),
                            MenuRecieved.class));
                    break;
                case menuSettings:
                    startActivity(new Intent(getApplicationContext(),
                            MenuSettings.class));
                    break;
                case menuExit:
                    startActivity(new Intent(getApplicationContext(), MenuExit.class));
                    break;
                }
                return super.onOptionsItemSelected(item);
            }
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to count how many characters a certain string has in PHP, but
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I am trying to understand how to use SyndicationItem to display feed which is
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
In my XML file chapters tag has more chapter tag.i need to display chapters
Seemingly simple, but I cannot find anything relevant on the web. What is the
I have a French site that I want to parse, but am running into
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

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.