title: Android - How to change menu item icon when clicked
body: <p>I currently have one item in my menu which is an icon of a pig. What I would like to happen is when I click on the pig, the icon will then change to another image like a chicken. I've read other forums on StackOverFlow but still no luck. </p>
  
  <p>I know you cannot use findViewbyId to reference a menu Item but the findItem method is not working for me or at least it says invalid. Please advise. </p>
  
  <p>Here is my current code: </p>
  
  <pre><code>    &lt;menu xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"&gt;
  
      &lt;item android:id="@+id/menuImage"
          android:title=""
          android:icon="@drawable/pig"
          android:orderInCategory="1"
          app:showAsAction="always|withText"/&gt;
      &lt;/menu&gt;
  
  
      @Override
  public boolean onCreateOptionsMenu(Menu menu) {
      getMenuInflater().inflate(R.menu.menu, menu);
      return super.onCreateOptionsMenu(menu);
  }
  
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
      switch (item.getItemId()){
          case R.id.menuImage:
              Toast.makeText(this, "YOU THINK YOU GOT THIS?", Toast.LENGTH_SHORT).show();
              MenuItem changeImage = (MenuItem) findViewById(R.id.menuImage);
              changeImage.setIcon(R.drawable.chicken);
              return true;
      }
      return true;
  }
  </code></pre>