Usually you directly use DialogFragment , whose name is explained independently.
here is an example of my code with int send as arg.
So basically you create a DialogFragment that extends DialogFragment . You must write the newInstance and onCreateDialog . Then you create a new instance of this fragment in the calling fragment.
public class YourDialogFragment extends DialogFragment { public static YourDialogFragment newInstance(int myIndex) { YourDialogFragment yourDialogFragment = new YourDialogFragment();
A call to a dialog fragment is performed from another fragment, doing this. Note that the value 0 is int i send.
YourDialogFragment yourDialogFragment = YourDialogFragment.newInstance(0); YourDialogFragment.show(getFragmentManager().beginTransaction(), "DialogFragment");
In your case, if you do not need to skip anything, delete the corresponding lines in the DialogFragment dialog box and do not pass any value to YourDialogFragment.newInstance()
EDIT / NEXT
Not sure to really understand your question. If you just need to replace the fragment with another, you use
getFragmentManager().beginTransaction().replace(R.id.your_fragment_container, new YourFragment()).commit();
source share