It seems that Fragment
s are deprecated in Android P. I am reading a book where they are used (which is not really strange after all) and I am trying to decide which is the best approach to deal with Dialog
s. In the relevant guide in the documentations the recommended approach suggest using the DialogFragment
from the support library and not from the Android P library since it's deprecated. I did not expect all the relevant guides to be updated to point to the today recommended approach but to me it's a bit confusing.
As I see it I have 2 options:
Dialog
s.Well, my question is since I am in the step of learning (and I don't have an existing project to maintain for example) which is the recommended approach for Dialog
s? The guide refers that:
Using DialogFragment to manage the dialog ensures that it correctly handles lifecycle events ...
and I know that using DialogFragment
guaranteed that my application would work flawlessly in every lifecycle event (if for example smart phone was rotated etc). So I probably shouldn't rely on Dialog
class itself either. So, which is the recommended approach?