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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:18:53+00:00 2026-05-24T13:18:53+00:00

can someone explain me the difference between: onMenuItemSelected (int featureId, MenuItem item) http://developer.android.com/reference/android/app/Activity.html#onMenuItemSelected%28int,%20android.view.MenuItem%29 and

  • 0

can someone explain me the difference between:

onMenuItemSelected (int featureId, MenuItem item)
http://developer.android.com/reference/android/app/Activity.html#onMenuItemSelected%28int,%20android.view.MenuItem%29

and

onOptionsItemSelected (MenuItem item)
http://developer.android.com/reference/android/app/Activity.html#onOptionsItemSelected%28android.view.MenuItem%29

in Android? I found a tutorial were someone overrides both methods.

// Reaction to the menu selection
@Override
public boolean onMenuItemSelected(int featureId, MenuItem item) {
    switch (item.getItemId()) {
    case R.id.insert:
        createTodo();
        return true;
    }
    return super.onMenuItemSelected(featureId, item);
}

@Override
public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
    case R.id.insert:
        createTodo();
        return true;
    }
    return super.onOptionsItemSelected(item);
}

Source: http://www.vogella.de/articles/AndroidSQLite/article.html

  • 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-24T13:18:53+00:00Added an answer on May 24, 2026 at 1:18 pm

    Android knows about several types of menus (e.g. Options Menu and Context Menu). onMenuItemSelected is the generic callback. You don’t need to use this usually. onOptionsItemSelected is the callback of the options menu and onContextItemSelected is the callback of the context menu. Use these two specific ones instead.

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

Sidebar

Related Questions

Can someone explain this to me? In particular the difference between: http://github.com/whymirror/greg and http://piumarta.com/software/peg/
Ok can someone explain to me the difference between: <script src=http://static.ak.connect.facebook.com/js/api_lib/v0.4/FeatureLoader.js.php type=text/javascript></script> and <script
Can someone explain to me the difference between: int *arr[5] vs. int (*arr)[5] vs.
Can someone explain the difference between the HTTP request and it handling and socket
Can someone explain the difference between these two, the first one is taken from
Can someone explain the difference between apache mod_wsgi in daemon mode and django fastcgi
Can someone please explain to me the difference between the AppSettings and ApplicationSettings sections
Can someone please explain me what's the difference between Swing and AWT? Are there
Can someone explain the difference between .last() and :last ? I can't seem to
Can someone explain the difference between using a $ when defining variables in jQuery

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.