Surprisingly, I couldn't find any posts regarding this, so here we go:
Why would I want to use a DialogFragment
over a simple Fragment
in Android? What advantages does the DialogFragment
have that I will miss out on if I just use a regular Fragment
?
Might be worth mentioning that I intend to have a fully customized view inside it...
Thanks!
A
DialogFragment
is no other than aFragment
that looks and acts like aDialog
would. So whether or not you want to use it is entirely depended on what do you want to make out of it.From my experience using
DialogFragment
, I tend to utilize it as a "detailed" view of a list item. The one that hovers on the list instead of covering it entirely (like a normalFragment
would) so that the user doesn't lose context.So that's that; you might want to use it wherever you want to show a view which either depend or need to retain its' parent context.
p.s., Yes, you can even put a fully customized view in a
DialogFragment
.