From b0d82fecff0036a774f067a0389a1b0a834f8bff Mon Sep 17 00:00:00 2001 From: Tony Mantler Date: Thu, 31 Oct 2013 10:36:24 -0700 Subject: [PATCH] Don't add Quick Response menu if there's no mReplyFromAccount b/11361756 Change-Id: I880d8f2089c1a50d13367b6fcf64344070280e27 --- .../android/email/activity/ComposeActivityEmail.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/com/android/email/activity/ComposeActivityEmail.java b/src/com/android/email/activity/ComposeActivityEmail.java index 16373d0b0..4f59e2c65 100644 --- a/src/com/android/email/activity/ComposeActivityEmail.java +++ b/src/com/android/email/activity/ComposeActivityEmail.java @@ -24,15 +24,21 @@ import android.widget.EditText; import com.android.email.R; import com.android.mail.compose.ComposeActivity; +import com.android.mail.utils.LogUtils; public class ComposeActivityEmail extends ComposeActivity implements InsertQuickResponseDialog.Callback { static final String insertQuickResponseDialogTag = "insertQuickResponseDialog"; @Override public boolean onCreateOptionsMenu(Menu menu) { - super.onCreateOptionsMenu(menu); - getMenuInflater().inflate(R.menu.email_compose_menu_extras, menu); - return true; + final boolean superCreated = super.onCreateOptionsMenu(menu); + if (mReplyFromAccount != null) { + getMenuInflater().inflate(R.menu.email_compose_menu_extras, menu); + return true; + } else { + LogUtils.d(LogUtils.TAG, "mReplyFromAccount is null, not adding Quick Response menu"); + return superCreated; + } } @Override