tutorial, no_image, android,

Android - no_image

Upendra Upendra Follow Jan 23, 2025 · 1 min read
Android - no_image
Share this

Dialog vs DialogFragment

The Dialog class is the base class for dialogs, but you should avoid instantiating Dialog directly. Instead, use one of it’s subclasses. Dialogs are entirely dependent on Activities. If the screen is rotated, the dialog is dismissed.

A DialogFragment is a fragment that displays a dialog window, floating on top of its activity’s window. This fragment contains a Dialog object, which it displays as appropriate based on the fragment’s state. Using DialogFragment to manage the dialog ensures that it correctly handles lifecycle events such as when the user presses the Back button or rotates the screen.

https://developer.android.com/reference/android/app/Dialog.html https://developer.android.com/reference/android/app/DialogFragment https://developer.android.com/guide/topics/ui/dialogs

credit goes to @swayangjit
Join Newsletter
Get the latest news right in your inbox. We never spam!
Upendra
Written by Upendra Follow
Hi, I am Upendra, the author in Human and machine languages,I don't know to how 3 liner bio works so just Connect with me on social sites you will get to know me better.