The lifecycle of BottomSheetDialogFragment
is the same as Fragment
.
This is quite easy to understand since, BottomSheetDialogFragment
extends AppCompatDialogFragment
(and adds just onCreateDialog()
functions), which in turn extends DialogFragment
(and add onCreateDialog()
& setupDialog()
functions), which in turn extends Fragment
.
DialogFragment
has the same lifecycle as Fragment
(reference). Since, none of the lifecycle methods were touched, AppCompatDialogFragment
and BottomSheetDialogFragment
will have the same lifecycle as Fragment
.
public Dialog onCreateDialog (Bundle savedInstanceState)
Override to build your own custom Dialog container. This is typically
used to show an AlertDialog instead of a generic Dialog; when doing
so, Fragment.onCreateView(android.view.LayoutInflater,
android.view.ViewGroup, android.os.Bundle) does not need to be
implemented since the AlertDialog takes care of its own content.
This method will be called after onCreate(android.os.Bundle) and
before Fragment.onCreateView(android.view.LayoutInflater,
android.view.ViewGroup, android.os.Bundle). The default implementation
simply instantiates and returns a Dialog class.
Note: DialogFragment own the Dialog#setOnCancelListener and
Dialog#setOnDismissListener callbacks. You must not set them yourself.
To find out about these events, override
onCancel(android.content.DialogInterface) and
onDismiss(android.content.DialogInterface).
Official documentation for further reference.