fragment to fragment

Solutions on MaxInterview for fragment to fragment by the best coders in the world

showing results for - "fragment to fragment"
Bautista
02 May 2019
1public void onClick2(View view) {
2    Fragment2 fragment2 = new Fragment2();
3    FragmentManager fragmentManager = getFragmentManager();
4    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
5    fragmentTransaction.replace(R.id.fragment1, fragment2);
6    fragmentTransaction.commit();
7}