PreferenceDialogFragment
public abstract class PreferenceDialogFragment extends DialogFragment implements DialogInterface.OnClickListener
| java.lang.Object | |||
| ↳ | android.app.Fragment | ||
| ↳ | android.app.DialogFragment | ||
| ↳ | androidx.preference.PreferenceDialogFragment |
EditTextPreferenceDialogFragment |
This class is deprecated. Use |
ListPreferenceDialogFragment |
This class is deprecated. Use |
MultiSelectListPreferenceDialogFragment |
This class is deprecated. Use |
Abstract base class which presents a dialog associated with a DialogPreference. Since the preference object may not be available during fragment re-creation, the necessary information for displaying the dialog is read once during the initial call to onCreate and saved/restored in the saved instance state. Custom subclasses should also follow this pattern.
Summary
Constants |
|
|---|---|
static final String |
ARG_KEY = "key"This field is deprecated. Use |
Public constructors |
|---|
|
This method is deprecated. Use |
Public methods |
|
|---|---|
DialogPreference |
This method is deprecated. Use |
void |
This method is deprecated. Use |
void |
This method is deprecated. |
@NonNull Dialog |
This method is deprecated. |
abstract void |
This method is deprecated. Use |
void |
This method is deprecated. |
void |
This method is deprecated. |
Protected methods |
|
|---|---|
void |
This method is deprecated. Use |
@Nullable View |
This method is deprecated. Use |
void |
This method is deprecated. Use |
Inherited Constants |
||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||
|
Inherited methods |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Public constructors
Public methods
public DialogPreferencegetPreference()
Get the preference that requested this dialog. Available after onCreate has been called on the PreferenceFragment which launched this dialog.
| Returns | |
|---|---|
DialogPreference |
The |
Protected methods
protected voidonBindDialogView(@NonNull View view)
Binds views in the content view of the dialog to data.
Make sure to call through to the superclass implementation.
protected @Nullable ViewonCreateDialogView(@NonNull Context context)
Creates the content view for the dialog (if a custom content view is required). By default, it inflates the dialog layout resource if it is set.
| See also | |
|---|---|
setLayoutResource |
protected voidonPrepareDialogBuilder(@NonNull AlertDialog.Builder builder)
Prepares the dialog builder to be shown when the preference is clicked. Use this to set custom properties on the dialog.