@Override public void onOpen() { invalidateOptionsMenu(); sThreadShowing = 0; // Notify the content that it is being closed, since the menu (i.e. conversation list) is being // opened. if (mContent != null) mContent.onContentClosing(); // Hide the soft keyboard KeyboardUtils.hide(this, getCurrentFocus()); showBackButton(false); }
@Override public void onClose() { invalidateOptionsMenu(); // Notify the content that it is being opened, since the menu (i.e. conversation list) is being // closed. if (mContent != null) { mContent.onContentOpening(); } if (mContent != null && mContent instanceof MessageListFragment) { sThreadShowing = ((MessageListFragment) mContent).getThreadId(); } else { sThreadShowing = 0; } // Hide the soft keyboard KeyboardUtils.hide(this, getCurrentFocus()); showBackButton(true); }
public void switchContent(ContentFragment fragment, boolean animate) { // Make sure that the activity isn't destroyed before making fragment transactions. if (fragment != null && !mIsDestroyed) { KeyboardUtils.hide(this); mContent = fragment; FragmentManager m = getFragmentManager(); // Only do a replace if it is a different fragment. if (fragment != m.findFragmentById(R.id.content_frame)) { getFragmentManager() .beginTransaction() .replace(R.id.content_frame, (Fragment) fragment) .commitAllowingStateLoss(); } mSlidingMenu.showContent(animate); invalidateOptionsMenu(); } else { Log.w(TAG, "Null fragment, can't switch content"); } }