@Override public void onClick(View view) { if (!isMessageOpen()) { return; // Ignore. } switch (view.getId()) { case R.id.reply: mCallback.onReply(); return; case R.id.reply_all: mCallback.onReplyAll(); return; case R.id.forward: mCallback.onForward(); return; case R.id.favorite: onClickFavorite(); return; case R.id.invite_link: onInviteLinkClicked(); return; case R.id.accept: onRespondToInvite( EmailServiceConstants.MEETING_REQUEST_ACCEPTED, R.string.message_view_invite_toast_yes); return; case R.id.maybe: onRespondToInvite( EmailServiceConstants.MEETING_REQUEST_TENTATIVE, R.string.message_view_invite_toast_maybe); return; case R.id.decline: onRespondToInvite( EmailServiceConstants.MEETING_REQUEST_DECLINED, R.string.message_view_invite_toast_no); return; case R.id.more: { PopupMenu popup = new PopupMenu(getActivity(), mMoreButton); Menu menu = popup.getMenu(); popup.getMenuInflater().inflate(R.menu.message_header_overflow_menu, menu); // Remove Reply if ReplyAll icon is visible or vice versa menu.removeItem(mDefaultReplyAll ? R.id.reply_all : R.id.reply); if (!FeatureQuery.FEATURE_EMAIL_SET_SYNCSIZE || (Utility.ENTIRE_MAIL == Utility.getAccountSyncSize(mContext, getMessage().mAccountKey)) || (getMessage().mFlagLoaded == Message.FLAG_LOADED_COMPLETE)) { menu.removeItem(R.id.fetch_entire_mail); } popup.setOnMenuItemClickListener(this); popup.show(); break; } } super.onClick(view); }