@Override public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: if (mSlidingPaneLayout.isSlideable() && !mSlidingPaneLayout.isOpen()) { // If showing the detail view, pressing Up should show the master pane. mSlidingPaneLayout.openPane(); return true; } break; case R.id.menu_search: if (!UIUtils.hasHoneycomb()) { startSearch(null, false, Bundle.EMPTY, false); return true; } break; } return super.onOptionsItemSelected(item); }
private void closeMenu() { if (sPaneLy.isSlideable()) { // We close the left fragment sPaneLy.closePane(); } }