Android call fragment from fragment

www‮l.‬autturi.com
Android call fragment from fragment
public void onClick(View view) {

    Fragment2 fragment2 = new Fragment2();
	
    FragmentManager fragmentManager = getFragmentManager();
	
    FragmentTransaction fragmentTransaction = fragmentManager.beginTransaction();
    fragmentTransaction.replace(R.id.fragment1, fragment2);
    fragmentTransaction.commit();
}
Created Time:2017-09-06 10:45:17  Author:lautturi