 <pre><code> ((MainActivity)getActivity()).mDrawerToggle.setDrawerIndicatorEnabled(false); ((MainActivity)getActivity()).getSupportActionBar().setDisplayHomeAsUpEnabled(true); getActivity().getSupportFragmentManager().beginTransaction() .add(R.id.frame, new DetailFragment())//here add add fragment on stack .addToBackStack(null) .commit(); </code></pre>