title: Customizing Overflow menu on a RecyclerView in android
body: <p>I am following a project similar to this: <a href="http://www.javatpoint.com/android-popup-menu-example" rel="nofollow">http://www.javatpoint.com/android-popup-menu-example</a></p>
  
  <p>I have created overflow menu on each item in my recyclerView. The menu is coming up properly. I have created menu item called Download, and another menu Item called Cancel Download. Something like this:</p>
  
  <p>popup.xml (Inside menu folder)</p>
  
  <pre><code>&lt;menu xmlns:android="http://schemas.android.com/apk/res/android" &gt;
  
      &lt;item
          android:id="@+id/video_download"
          android:title="Download"/&gt;
  
      &lt;item
          android:id="@+id/video_download_cancel"
          android:title="Cancel Download"
          android:visible="false"/&gt;
  &lt;/menu&gt;
  </code></pre>
  
  <p>The pop menu is showing up properly without any issues. </p>
  
  <p>Now the question is that:</p>
  
  <p>OnClick of Download I would like to make the <strong>video_download</strong> to be hidden and <strong>video_download_cancel</strong> to be visible.</p>
  
  <p>Is this possible?</p>
  
  <p>Here is the click event for the overflow menu (Three vertical dots) I have created:</p>
  
  <pre><code>personViewHolder.video_menu.setOnClickListener(new View.OnClickListener()
          {
              @Override
              public void onClick(View v)
              {
                  final PopupMenu popup = new PopupMenu(mContext, v);
                  popup.getMenuInflater().inflate(R.menu.popmenu, popup.getMenu());
                  popup.setOnMenuItemClickListener(new PopupMenu.OnMenuItemClickListener()
                  {
                      @Override
                      public boolean onMenuItemClick(MenuItem item)
                      {
                          Intent intent = new Intent(mContext, Download_Service.class);
                          intent.putExtra("link", urlstring);
                          mContext.startService(intent);
  
                          return true;
                      }
  
                  });
  
                  popup.show();
              }
          });
  </code></pre>
  
  <p>where video_menu is an image(three dot vertical). </p>