1FragmentManager manager = getFragmentManager();
2FragmentTransaction transaction = manager.beginTransaction();
3transaction.add(R.id.container,YOUR_FRAGMENT_NAME,YOUR_FRAGMENT_STRING_TAG);
4transaction.addToBackStack(null);
5transaction.commit();
6
1// put the following code in onClickListner
2// public void onClickListner(View view){
3Navigation.findNavController(view).navigate(R.id.action_fromFragment_toFragment);
4// action_fromFragment_toFragment is the id of transformatino, look in fragment map.
5// }