From 0cd7eb12ed9e8a88d82d91973472cc9585b29665 Mon Sep 17 00:00:00 2001 From: cketti Date: Wed, 6 Feb 2013 18:11:29 +0100 Subject: [PATCH] Don't call MessageListFragment methods until initialization is complete --- src/com/fsck/k9/activity/MessageList.java | 3 ++- src/com/fsck/k9/fragment/MessageListFragment.java | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/com/fsck/k9/activity/MessageList.java b/src/com/fsck/k9/activity/MessageList.java index 30c99fd68..276e4f95d 100644 --- a/src/com/fsck/k9/activity/MessageList.java +++ b/src/com/fsck/k9/activity/MessageList.java @@ -978,7 +978,8 @@ public class MessageList extends K9FragmentActivity implements MessageListFragme menu.findItem(R.id.search).setVisible(false); menu.findItem(R.id.search_remote).setVisible(false); - if (mDisplayMode == DisplayMode.MESSAGE_VIEW || mMessageListFragment == null) { + if (mDisplayMode == DisplayMode.MESSAGE_VIEW || mMessageListFragment == null || + !mMessageListFragment.isInitialized()) { menu.findItem(R.id.check_mail).setVisible(false); menu.findItem(R.id.set_sort).setVisible(false); menu.findItem(R.id.select_all).setVisible(false); diff --git a/src/com/fsck/k9/fragment/MessageListFragment.java b/src/com/fsck/k9/fragment/MessageListFragment.java index e1ba5a831..3334721fe 100644 --- a/src/com/fsck/k9/fragment/MessageListFragment.java +++ b/src/com/fsck/k9/fragment/MessageListFragment.java @@ -920,7 +920,6 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick updateFooterView(); } - mController = MessagingController.getInstance(getActivity().getApplication()); mListView.setAdapter(mAdapter); } @@ -3349,4 +3348,8 @@ public class MessageListFragment extends SherlockFragment implements OnItemClick public boolean isSingleFolderMode() { return mSingleFolderMode; } + + public boolean isInitialized() { + return mInitialized; + } }