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();