Example #1
0
 @Override
 protected void onDetachedFromWindow() {
   if (mPopupMenu != null) {
     mPopupMenu.dismiss();
   }
   super.onDetachedFromWindow();
 }
Example #2
0
 public void show() {
   if (mPopupMenu != null) {
     mPopupMenu.dismiss();
   }
   removeAllViews();
   for (final MenuItem item : ((MenuImpl) mMenu).getMenuItems()) {
     if (item.isVisible()) {
       addMenuButton(item);
     }
   }
   invalidate();
 }