title: Android ActionBar - Item icon change continuously?
body: <p>On my ActionBar there is one item that has an icon about a star(without filled).
  When the user clicks on it, the icon changes to another icon(filled star).
  But the problem is that if the user cliccks again the icon doesn't change one more time.</p>
  
  <p>So, this is what i want</p>
  
  <p>icon1->click->icon2->click->icon1->click->icon2</p>
  
  <p>My item xml:</p>
  
  <pre><code>&lt;item
      android:id="@+id/bookmark"
      android:icon="@drawable/bookmark"
      android:showAsAction="ifRoom"
      android:title="Add to Favorites"/&gt;
  </code></pre>
  
  <p>My Java for actionBar:</p>
  
  <pre><code>@Override
  public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {
      super.onCreateOptionsMenu(menu, inflater);
      menu.clear();
      inflater.inflate(R.menu.activity_desc, menu);
  }
  
  
  
  @Override
    public boolean onOptionsItemSelected(MenuItem item) {
  
      if(item.getItemId() == R.id.bookmark){
  
  
  
          // i tried this: something like: if(item.getIcon() == (R.drawable.nobookmark){} it doesn't work 
  
  
          item.setIcon(R.drawable.nobookmark);
  
          return true;
      }
  
      return true;
  
    }
  </code></pre>