diff --git a/QKSMS/src/main/java/com/moez/QKSMS/ui/MainActivity.java b/QKSMS/src/main/java/com/moez/QKSMS/ui/MainActivity.java index 99fe9f41..cb202516 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/ui/MainActivity.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/ui/MainActivity.java @@ -389,18 +389,19 @@ public class MainActivity extends QKActivity implements SlidingMenu.OnOpenListen public boolean onKeyUp(int keyCode, KeyEvent event) { if (keyCode == KeyEvent.KEYCODE_BACK) { if (!mSlidingMenu.isMenuShowing()) { - Fragment category = getFragmentManager() - .findFragmentByTag(SettingsFragment.CATEGORY_TAG); + Fragment category = getFragmentManager().findFragmentByTag(SettingsFragment.CATEGORY_TAG); if (category != null) { - getFragmentManager().beginTransaction() - .remove(category) - .commit(); + getFragmentManager().beginTransaction().remove(category).commit(); } else { mSlidingMenu.showMenu(); } return true; } else { - finish(); + if (menuFragment.isShowingBlocked()) { + menuFragment.setShowingBlocked(false); + } else { + finish(); + } } } diff --git a/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java b/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java index 45134b9b..cd811d7f 100644 --- a/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java +++ b/QKSMS/src/main/java/com/moez/QKSMS/ui/conversationlist/ConversationListFragment.java @@ -161,10 +161,7 @@ public class ConversationListFragment extends QKFragment implements LoaderManage return true; case R.id.menu_blocked: - mShowBlocked = !mShowBlocked; - mContext.setTitle(mShowBlocked ? R.string.title_blocked : R.string.title_conversation_list); - BlockedConversationHelper.bindBlockedMenuItem(mContext, mPrefs, mBlockedItem, mShowBlocked); - initLoaderManager(); + setShowingBlocked(!mShowBlocked); return true; } @@ -175,6 +172,17 @@ public class ConversationListFragment extends QKFragment implements LoaderManage return mShowBlocked ? R.string.title_blocked : R.string.title_conversation_list; } + public boolean isShowingBlocked() { + return mShowBlocked; + } + + public void setShowingBlocked(boolean showBlocked) { + mShowBlocked = showBlocked; + mContext.setTitle(mShowBlocked ? R.string.title_blocked : R.string.title_conversation_list); + BlockedConversationHelper.bindBlockedMenuItem(mContext, mPrefs, mBlockedItem, mShowBlocked); + initLoaderManager(); + } + @Override public void onItemClick(Conversation conversation, View view) { if (mAdapter.isInMultiSelectMode()) {