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