0
我想在关闭活动时更改Fragment。我试图进入活动,FragmentTransaction但它不是正确的方式。我能怎么做?谢谢Android更改时关闭ActivityDialog
Fragment newFragment = new Ele_Fragment();
FragmentTransaction transaction = getFragmentManager().beginTransaction();
// Replace whatever is in the fragment_container view with this fragment,
// and add the transaction to the back stack
transaction.replace(R.id.frame_container, newFragment);
transaction.addToBackStack(null);
// Commit the transaction
transaction.commit();