title: Popup Menu won't change its selected state
body: <p>I have this code here, I created a popup menu when the user long-presses the "edit_text" view's area which displays a popup menu with "Red" "Yellow" radio button option which changes the background color of the "text_view", but I'm not sure why when I select the other option, like when red is currently selected, I select yellow and the other way around(I have the red option selected as the default state), the selected state does not change at all, red is still selected no matter how many times I press yellow. Could you guys help me with this please? Thank you very much.</p>
  
  <pre><code>@Override
  protected void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_main);
  
      edit_text = (EditText)findViewById(R.id.edit_text_1);
      text_view = (TextView)findViewById(R.id.textView1);
  
      //==========_CREATE A POPUP MENU WHEN LONG-CLICK ON EDITTEXT AREA_==========\\
  
      edit_text.setOnLongClickListener(new OnLongClickListener() {
          public boolean onLongClick(View v) {
              final PopupMenu pop_up = new PopupMenu(getContext(), v);
  
              getMenuInflater().inflate(R.menu.main, pop_up.getMenu());
  
              //GROUP'S ID IS "group".
              pop_up.getMenu().setGroupCheckable(R.id.group, true, true);
  
              pop_up.show();
  
              pop_up.setOnMenuItemClickListener(listener);
              return true;
          }
      });
  
  
  }   
  OnMenuItemClickListener listener = new OnMenuItemClickListener() {
      public boolean onMenuItemClick(MenuItem item) {
          switch(item.getItemId()) {
  
          case R.id.red:
              text_view.setBackgroundColor(Color.RED);
              if (!item.isChecked()) {
  
                  item.setChecked(true);
              }
              return true;
  
          case R.id.yellow:
              text_view.setBackgroundColor(Color.YELLOW);
              if (!item.isChecked()) {
  
                  item.setChecked(true);
              }
              return true;
  
          default:
              return false;
          }
      }
  };
  protected Context getContext() {
      return this;
  }
  </code></pre>