Check out example codes for "change fragment in android studio". It will help you in understanding the concepts better.

Code Example 1

// put the following code in onClickListner
// public void onClickListner(View view){
Navigation.findNavController(view).navigate(R.id.action_fromFragment_toFragment);
// action_fromFragment_toFragment is the id of transformatino, look in fragment map.
// }

Learn ReactJs, React Native from akashmittal.com