how to close a fragment on button click from android.r.content code example
Example: how to close the fragment by a close button in android
getActivity(). getFragmentManager(). popBackStack();
getActivity(). getFragmentManager(). popBackStack();