diff --git a/src/com/android/email/activity/MailboxListFragment.java b/src/com/android/email/activity/MailboxListFragment.java index 79aac6897..d475318de 100644 --- a/src/com/android/email/activity/MailboxListFragment.java +++ b/src/com/android/email/activity/MailboxListFragment.java @@ -221,6 +221,8 @@ public class MailboxListFragment extends ListFragment implements OnItemClickList /** * Create a new instance with initialization parameters. + * + * This fragment should be created only with this method. (Arguments should always be set.) */ public static MailboxListFragment newInstance(long accountId, long parentMailboxId) { final MailboxListFragment instance = new MailboxListFragment(); @@ -275,7 +277,10 @@ public class MailboxListFragment extends ListFragment implements OnItemClickList registerForContextMenu(mListView); final Bundle args = getArguments(); - openMailboxes(args.getLong(ARG_ACCOUNT_ID), args.getLong(ARG_PARENT_MAILBOX_ID)); + // STOPSHIP remove the check. Right now it's needed for the obsolete phone activities. + if (args != null) { + openMailboxes(args.getLong(ARG_ACCOUNT_ID), args.getLong(ARG_PARENT_MAILBOX_ID)); + } } public void setCallback(Callback callback) { diff --git a/src/com/android/email/activity/MessageListFragment.java b/src/com/android/email/activity/MessageListFragment.java index b61b2b5f4..f556a9e85 100644 --- a/src/com/android/email/activity/MessageListFragment.java +++ b/src/com/android/email/activity/MessageListFragment.java @@ -236,6 +236,8 @@ public class MessageListFragment extends ListFragment /** * Create a new instance with initialization parameters. + * + * This fragment should be created only with this method. (Arguments should always be set.) */ public static MessageListFragment newInstance(long mailboxId) { final MessageListFragment instance = new MessageListFragment(); @@ -293,7 +295,10 @@ public class MessageListFragment extends ListFragment } final Bundle args = getArguments(); - openMailbox(args.getLong(ARG_MAILBOX_ID)); + // STOPSHIP remove the check. Right now it's needed for the obsolete phone activities. + if (args != null) { + openMailbox(args.getLong(ARG_MAILBOX_ID)); + } } @Override diff --git a/src/com/android/email/activity/MessageViewFragment.java b/src/com/android/email/activity/MessageViewFragment.java index fbfe735d2..6f8834772 100644 --- a/src/com/android/email/activity/MessageViewFragment.java +++ b/src/com/android/email/activity/MessageViewFragment.java @@ -141,6 +141,8 @@ public class MessageViewFragment extends MessageViewFragmentBase /** * Create a new instance with initialization parameters. + * + * This fragment should be created only with this method. (Arguments should always be set.) */ public static MessageViewFragment newInstance(long messageId) { final MessageViewFragment instance = new MessageViewFragment(); @@ -194,7 +196,10 @@ public class MessageViewFragment extends MessageViewFragmentBase super.onActivityCreated(savedInstanceState); final Bundle args = getArguments(); - openMessage(args.getLong(ARG_MESSAGE_ID)); + // STOPSHIP remove the check. Right now it's needed for the obsolete phone activities. + if (args != null) { + openMessage(args.getLong(ARG_MESSAGE_ID)); + } } @Override