I could not find proper lifecycle of android.support.v4.app.DialogFragment
by searching on Google. I need this for some implementation. As we know DialogFragment
has some methods same like Dialog
.
DialogFragment
extends Fragment
so its lifecycle is same as Fragment
. But what about other methods of DialogFragment
?
Here is Fragment
lifecycle. Can one provide for DialogFragment
?
Source : https://developer.android.com/reference/android/app/DialogFragment#lifecycle
Strange, that if you created an
AlertDialog
inonCreateDialog()
, didn't callonCreateView()
, thenonViewCreated()
wouldn't also call.See Android DialogFragment onViewCreated not called and OnCreateView not called in a dialogfragment from a fragment.
DialogFragment
life cycle is similar to the life cycle offragment:
. To test yourself put logs in each of theoverrided
methods ofdialogFragment
and then run your code you will understand the working ofdialogFragment
.And as far as finishing or destroying dialogFragment is concerned the lifeCycle is as follows:
Also I believe this method will also help you know the
lifecycle
: