I have a basic action with a fragment layout. The box has 3 options:
Fragment[1], Fragment[2], Fragment[3].
The inner fragment [2] and fragment [3] are one button. This button opens another fragment. Fragment [4].
I want Fragment [4] without a box, but with a back button.
This is the onClick code in the snippet [2]
Fragment fragment = new InstalacionesEncontradasFragment(); Bundle bundle = new Bundle(); bundle.putSerializable("key", this.instalacionesConCategorias); fragment.setArguments(bundle); FragmentManager fragmentManager = getFragmentManager(); FragmentTransaction mFragmentTransaction = fragmentManager.beginTransaction(); mFragmentTransaction.addToBackStack(null); mFragmentTransaction.replace(R.id.main_frame_container, fragment, "ACTIVIDADES").commit();
And in the Fragment [4]
onCreate a method:
getActivity().getActionBar().setDisplayHomeAsUpEnabled(true);
But this solution does not work.
How to disconnect a box? Where should I use the back button? In fragment [2] or fragment [3]?
source share