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 3283444
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T20:02:33+00:00 2026-05-17T20:02:33+00:00

My select_screen_menu.xml <?xml version=1.0 encoding=utf-8?> <menu xmlns:android=http://schemas.android.com/apk/res/android> <item android:id=@+id/home_menu android:icon=@drawable/home_tab android:title=Home /> <item android:id=@+id/submit_report

  • 0

My select_screen_menu.xml

<?xml version="1.0" encoding="utf-8"?>

<menu

  xmlns:android="http://schemas.android.com/apk/res/android">

  <item android:id="@+id/home_menu"
      android:icon="@drawable/home_tab"
      android:title="Home" />
 <item android:id="@+id/submit_report"
      android:icon="@drawable/submit_tab"
      android:title="Submit a Report" />
  <item android:id="@+id/search_list"
      android:icon="@drawable/search_icon"
      android:title="Search the List" />

</menu>

and my activity class used it as

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

public boolean onOptionsItemSelected(MenuItem item) {  
  switch (item.getItemId()) {
    case R.id.home_menu: {
      Static.backwardTo(User.viewflipper,ConstandsUsed.USER_SELECT_SCREEN);
      return true;
    }
    case R.id.submit_report:
      Static.backwardTo(User.viewflipper, User.sumitAReport_PAGE);
      return true;
    case R.id.search_list:
      Static.backwardTo(User.viewflipper, User.searchTheList_PAGE);
      return true;
    default:
      return super.onOptionsItemSelected(item);      
  }
}

i have used the following code to identify the back button

public boolean onKeyDown(int keyCode, KeyEvent event) {
---
---
}

this two are not working together. The menu will work only when this onkeydown function is removed.
Is there any way to use this together
Do I need to do any other things?

Please help me, thanks

  • 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-17T20:02:33+00:00Added an answer on May 17, 2026 at 8:02 pm

    Thanks and sorry to every one. i understood my mistake actually i am always return true from the onkeydown function. when i change to return false if it is not the keycode that i need its work well

     public boolean onKeyDown(int keyCode, KeyEvent event) {
    if(){
    ------
    return true;
    }
    else
    return false;
    }
    

    Thank you

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

Sidebar

Related Questions

Steps: I start my Android app. I press the Menu button and select Preferences
when i create a cocos2d projecyt, XCode menu item Project\Upgrade Current Target for iPad
Okay, I'm working on a iPhone game. You start off on a menu screen,
My app has 6 menu items, so the OS shows the first 4, then
Original goal: I have a TreeMenu that i use to display my Menu. In
I hover over my menu and a submenu expands, then this bad boy comes
I built my first Android app. It is a Live Wallpaper designed for 2.2.
I want to get the header of a selected tab-item of a tab-control and
I'm attempting to learn the ropes of Game Development and Android and it's been
When I select a file to attach in gmail compose screen, It automatically uploads

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.