title: Android PopUpMenu on phones integrated button
body: <p>I want to create a pop menu on Android but I want it to be shown on touch of the phones hardware button, not on the screen.</p>
  
  <p>But the tutorial is only on touch of some button on the screen. How do I respond to the touch of the phone's already existing buttons?</p>
  
  <p>Don’t want an image button, but the integrated button in the phone.</p>
  
  <pre><code>&lt;ImageButton
     android:layout_width="wrap_content" 
     android:layout_height="wrap_content" 
     android:src="@drawable/ic_overflow_holo_dark"
     android:contentDescription="@string/descr_overflow_button"
     android:onClick="showPopup" /&gt;
  
  
  public void showPopup(View v) {
      PopupMenu popup = new PopupMenu(this, v);
      MenuInflater inflater = popup.getMenuInflater();
      inflater.inflate(R.menu.actions, popup.getMenu());
      popup.show();
  }
  </code></pre>