title: How to do click event on menu item?
body: <p>I am entering all the data in TextBox,when i press the submit button it is working but I am doing same thing on Menuitem button then it doesn't work.
  My code is:</p>
  
  <pre><code>@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      Log.i(TAG,"Information - onCreate() ...");
      setContentView(R.layout.activity_main);
  
      View promptButton = findViewById(R.id.submit_button);
      promptButton.setOnClickListener((OnClickListener) this);
  
  }
  public void onClick(View v) {
      RadioGroup radioGroup = (RadioGroup) findViewById(R.id.greetingsRadioGroup);
      int checkedRadioButton = radioGroup.getCheckedRadioButtonId();
  
  
      switch (checkedRadioButton) {
      case R.id.mrButton : 
        choice = "Mr.";
        break;
    case R.id.mrsButton : 
        choice = "Mrs.";
        break;
    case R.id.msButton: 
        choice = "Ms.";
        break;
    case R.id.drButton: 
        choice = "Dr.";
        break;
      }
  
  
           EditText namef = (EditText) findViewById(R.id.firstname); 
           EditText namel = (EditText) findViewById(R.id.lastname);  
           EditText add1 = (EditText) findViewById(R.id.address); 
           Spinner pro1 = (Spinner) findViewById(R.id.spinner1);  
           EditText coun1 = (EditText) findViewById(R.id.country);  
           EditText pcode1 = (EditText) findViewById(R.id.postalCode); 
  
              switch(v.getId()){
                  case R.id.submit_button:
                      Intent j = new Intent(this, Animation.class);
                      fname = namef.getText().toString();
                      lname = namel.getText().toString();
                      add = add1.getText().toString();
                      pro = pro1.getSelectedItem().toString();
                      coun = coun1.getText().toString();
                      pcode = pcode1.getText().toString();
                      j.putExtra("choice", choice);
                      j.putExtra("fname", fname);
                      j.putExtra("lname", lname);
                      j.putExtra("add", add);
                      j.putExtra("pro", pro);
                      j.putExtra("coun", coun);
                      j.putExtra("pcode", pcode);
                      startActivity(j);
                      break;  
                  case R.id.menu_anim:
                      Intent k = new Intent(this, Animation.class);
                      fname = namef.getText().toString();
                      lname = namel.getText().toString();
                      add = add1.getText().toString();
                      pro = pro1.getSelectedItem().toString();
                      coun = coun1.getText().toString();
                      pcode = pcode1.getText().toString();
                      k.putExtra("choice", choice);
                      k.putExtra("fname", fname);
                      k.putExtra("lname", lname);
                      k.putExtra("add", add);
                      k.putExtra("pro", pro);
                      k.putExtra("coun", coun);
                      k.putExtra("pcode", pcode);
                      startActivity(k);
                      break;
  
           }
  
  
      }
  }
  
  
  protected void onActivityResult(int requestCode, int resultCode, Intent d1) {
      // TODO Auto-generated method stub
      super.onActivityResult(requestCode, resultCode, d1);
  
      if(requestCode == START)
      {
          Toast.makeText(this, "Your download has resumed.", Toast.LENGTH_LONG).show();
      }
  }
  
  
  @Override
  public boolean onCreateOptionsMenu(Menu menu) {
  
     super.onCreateOptionsMenu(menu);
  
      this.myMenu = menu;
  
      MenuInflater mi = this.getMenuInflater();
      mi.inflate(R.menu.my_menu,menu);
  
      return true;
  }
  </code></pre>
  
  <p>I don't know What i can write in this <code>switch Case R.id.menu_anim</code>...</p>
  
  <p>Can i call the <code>onClick(View v)</code>?
  If yes, how can i call it?</p>
  
  <pre><code>private boolean handleMenus(MenuItem item)
  {
      switch (item.getItemId()) {
      case R.id.menu_anim:
  
          break;
      }
  
  return true;
  }
  </code></pre>