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}