I have an Activity
with multiple Fragment
s. I want to show a DialogFragment
or open another Fragment
from one of the
Have you tried something like this (from the Fragment):
FragmentTransaction ft =
getActivity().getSupportFragmentManager().beginTransaction();
Fragment prev =
getActivity().getSupportFragmentManager().findFragmentByTag("some_name");
if (prev != null) {
ft.remove(prev);
}
ft.addToBackStack(null);
DialogFragment dialogFragment = DialogFragmentClass.newInstance();
dialogFragment.show(ft, "some_name");
Let me know, cheers.