Android DialgFragemnt dialog&inflater

two ways to create and init its views

window-dialog

 @MainThread
 @NonNull
 public Dialog onCreateDialog(@Nullable Bundle savedInstanceState) {
        return new Dialog(requireContext(), getTheme());
}

 View rootView = LayoutInflater.from(getContext()).inflate(R.layout.dialog_exit_app)
 init...
 dialog.setContentView(rootView)

inflater-view

@Override
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
        View rootView = LayoutInflater.from(getContext()).inflate(R.layout.dialog_exit_app)
        init...
        return rootView;
    }

diffrence:

dialog:

you cant add other componnes, such as Fragemnt, if you do , you will get.

Fragment does not have a view

inflater:

childFragemntManager is safe.

dialogFrament?.childFragmentManager?.commit {
                add(placeHolderId, fragment)
                setReorderingAllowed(true)
            }