I have a Fragment calling a DialogFragment. Does this affect the lifecyle of the Fragment (i.e. does it go to onPause)? When the DialogFragment is dismissed, does the calling Fragment go to onResume?
Both of those fragments will be in the running state. onPause will not be called on the first fragment.
The lifecycle callbacks of Fragments (and Activities) work on an Activity level, not a fragment level. As an example, if you show an Activity that is themed to look like a dialog on top of the first fragment, then onPause will be called on that first fragment.
Fragments do not affect the lifecycle of other fragments.
The Dialog fragment will be present in a Dialog window above your activity with a Fragment. The Activity and the Fragment will not change their state.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With