Prevent crash when composing a message on tablets.

We were hiding the cc/bcc menu option, but on tablets that is a visible
button on the UI and not in the menu. whoops.

Bug: 5067057
Change-Id: I10ecaf115b589b9200529f6ea7703428456b8f0f
This commit is contained in:
Ben Komalo 2011-07-22 10:00:39 -07:00
parent 6a902861e9
commit a10d4a8e45

View File

@ -1897,8 +1897,12 @@ public class MessageCompose extends Activity implements OnClickListener, OnFocus
@Override @Override
public boolean onPrepareOptionsMenu(Menu menu) { public boolean onPrepareOptionsMenu(Menu menu) {
menu.findItem(R.id.save).setEnabled(mDraftNeedsSaving); menu.findItem(R.id.save).setEnabled(mDraftNeedsSaving);
menu.findItem(R.id.add_cc_bcc).setVisible( MenuItem addCcBcc = menu.findItem(R.id.add_cc_bcc);
(mCcBccContainer == null) || (mCcBccContainer.getVisibility() != View.VISIBLE)); if (addCcBcc != null) {
// Only available on phones.
addCcBcc.setVisible(
(mCcBccContainer == null) || (mCcBccContainer.getVisibility() != View.VISIBLE));
}
MenuItem insertQuickResponse = menu.findItem(R.id.show_quick_text_list_dialog); MenuItem insertQuickResponse = menu.findItem(R.id.show_quick_text_list_dialog);
insertQuickResponse.setVisible(mQuickResponsesAvailable); insertQuickResponse.setVisible(mQuickResponsesAvailable);
insertQuickResponse.setEnabled(mQuickResponsesAvailable); insertQuickResponse.setEnabled(mQuickResponsesAvailable);