Fragment Transaction:-
Simple Fragment Transaction:
Fragment 1:
Fragment fragment = new EditProfileFragment();
Bundle bundle = new Bundle();
bundle.putString("myrideRideId", "1035");
fragment.setArguments(bundle);
getActivity().getSupportFragmentManager()
.beginTransaction()
.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left,
Bundle bundle = new Bundle();
bundle.putString("myrideRideId", "1035");
fragment.setArguments(bundle);
getActivity().getSupportFragmentManager()
.beginTransaction()
.setCustomAnimations(R.anim.enter_from_right, R.anim.exit_to_left,
R.anim.enter_from_left, R.anim.exit_to_right)
.replace(R.id.frame_container, fragment)
.addToBackStack(null)
.commit();
.replace(R.id.frame_container, fragment)
.addToBackStack(null)
.commit();
Fragment 2:
getActivity().getSupportFragmentManager().popBackStackImmediate();Simple Fragment Add:
getSupportFragmentManager().beginTransaction()
.add(R.id.frame_container, fragment)
.commit();
No comments:
Post a Comment