public class AppCompatDialogFragment
extends DialogFragment


A special version of DialogFragment which uses an AppCompatDialog in place of a platform-styled dialog.

See also:


Inherited constants

Public constructors


Public methods

Dialog onCreateDialog(Bundle savedInstanceState)

Override to build your own custom Dialog container.

Inherited methods

Public constructors


public AppCompatDialogFragment ()

Public methods


public Dialog onCreateDialog (Bundle savedInstanceState)

Override to build your own custom Dialog container. This is typically used to show an AlertDialog instead of a generic Dialog; when doing so, Fragment.onCreateView(LayoutInflater, ViewGroup, Bundle) does not need to be implemented since the AlertDialog takes care of its own content.

This method will be called after onCreate(Bundle) and immediately before Fragment.onCreateView(LayoutInflater, ViewGroup, Bundle). The default implementation simply instantiates and returns a Dialog class.

Note: DialogFragment own the Dialog.setOnCancelListener and Dialog.setOnDismissListener callbacks. You must not set them yourself. To find out about these events, override onCancel(DialogInterface) and onDismiss(DialogInterface).

savedInstanceState Bundle: The last saved instance state of the Fragment, or null if this is a freshly created Fragment.

Dialog Return a new Dialog instance to be displayed by the Fragment.