PreferenceDialogFragment

Added in 1.0.0
Deprecated in 1.1.0

public abstract class PreferenceDialogFragment extends DialogFragment implements DialogInterface.OnClickListener


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 PreferenceDialogFragmentCompat instead

Public constructors

This method is deprecated.

Use PreferenceDialogFragmentCompat instead

Public methods

DialogPreference

This method is deprecated.

Use PreferenceDialogFragmentCompat instead

void
onClick(@NonNull DialogInterface dialog, int which)

This method is deprecated.

Use PreferenceDialogFragmentCompat instead

void
onCreate(@Nullable Bundle savedInstanceState)

This method is deprecated.

@NonNull Dialog
onCreateDialog(@Nullable Bundle savedInstanceState)

This method is deprecated.

abstract void
onDialogClosed(boolean positiveResult)

This method is deprecated.

Use PreferenceDialogFragmentCompat instead

void

This method is deprecated.

void

This method is deprecated.

Protected methods

void

This method is deprecated.

Use PreferenceDialogFragmentCompat instead

@Nullable View

This method is deprecated.

Use PreferenceDialogFragmentCompat instead

void

This method is deprecated.

Use PreferenceDialogFragmentCompat instead

Inherited Constants

From android.content.ComponentCallbacks2
static final int
static final int
static final int
static final int
static final int
static final int
static final int
From android.app.DialogFragment
static final int

This field is deprecated.

static final int

This field is deprecated.

static final int

This field is deprecated.

static final int

This field is deprecated.

Inherited methods

From android.app.DialogFragment
void

This method is deprecated.

void

This method is deprecated.

void
dump(String prefix, FileDescriptor fd, PrintWriter writer, String[] args)

This method is deprecated.

Dialog

This method is deprecated.

boolean

This method is deprecated.

int

This method is deprecated.

boolean

This method is deprecated.

void
onActivityCreated(Bundle savedInstanceState)

This method is deprecated.

void
onAttach(Context context)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

LayoutInflater
onGetLayoutInflater(Bundle savedInstanceState)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
setCancelable(boolean cancelable)

This method is deprecated.

void
setShowsDialog(boolean showsDialog)

This method is deprecated.

void
setStyle(int style, int theme)

This method is deprecated.

void
show(FragmentManager manager, String tag)

This method is deprecated.

int
show(FragmentTransaction transaction, String tag)

This method is deprecated.

From android.app.Fragment
final boolean

This method is deprecated.

final Activity

This method is deprecated.

boolean

This method is deprecated.

boolean

This method is deprecated.

final Bundle

This method is deprecated.

final FragmentManager

This method is deprecated.

Context

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

final FragmentManager

This method is deprecated.

final Object

This method is deprecated.

final int

This method is deprecated.

final LayoutInflater

This method is deprecated.

LoaderManager

This method is deprecated.

final Fragment

This method is deprecated.

Transition

This method is deprecated.

final Resources

This method is deprecated.

final boolean

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

Transition

This method is deprecated.

final String
getString(int resId)

This method is deprecated.

final String

This method is deprecated.

final Fragment

This method is deprecated.

final int

This method is deprecated.

final CharSequence
getText(int resId)

This method is deprecated.

boolean

This method is deprecated.

View

This method is deprecated.

final int

This method is deprecated.

static Fragment
instantiate(Context context, String fname)

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

final boolean

This method is deprecated.

void
onActivityResult(int requestCode, int resultCode, Intent data)

This method is deprecated.

void
onAttachFragment(Fragment childFragment)

This method is deprecated.

void

This method is deprecated.

boolean

This method is deprecated.

Animator
onCreateAnimator(int transit, boolean enter, int nextAnim)

This method is deprecated.

void
onCreateContextMenu(
    ContextMenu menu,
    View v,
    ContextMenu.ContextMenuInfo menuInfo
)

This method is deprecated.

void

This method is deprecated.

View
onCreateView(
    LayoutInflater inflater,
    ViewGroup container,
    Bundle savedInstanceState
)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
onHiddenChanged(boolean hidden)

This method is deprecated.

void
onInflate(AttributeSet attrs, Bundle savedInstanceState)

This method is deprecated.

void

This method is deprecated.

void
onMultiWindowModeChanged(
    boolean isInMultiWindowMode,
    Configuration newConfig
)

This method is deprecated.

boolean

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
onPictureInPictureModeChanged(
    boolean isInPictureInPictureMode,
    Configuration newConfig
)

This method is deprecated.

void

This method is deprecated.

void
onRequestPermissionsResult(
    int requestCode,
    String[] permissions,
    int[] grantResults
)

This method is deprecated.

void

This method is deprecated.

void
onTrimMemory(int level)

This method is deprecated.

void
onViewCreated(View view, Bundle savedInstanceState)

This method is deprecated.

void
onViewStateRestored(Bundle savedInstanceState)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

final void
requestPermissions(String[] permissions, int requestCode)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
setHasOptionsMenu(boolean hasMenu)

This method is deprecated.

void

This method is deprecated.

void
setMenuVisibility(boolean menuVisible)

This method is deprecated.

void

This method is deprecated.

void
setRetainInstance(boolean retain)

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void

This method is deprecated.

void
setTargetFragment(Fragment fragment, int requestCode)

This method is deprecated.

void
setUserVisibleHint(boolean isVisibleToUser)

This method is deprecated.

boolean

This method is deprecated.

void

This method is deprecated.

void
startActivityForResult(Intent intent, int requestCode)

This method is deprecated.

void
startIntentSenderForResult(
    IntentSender intent,
    int requestCode,
    Intent fillInIntent,
    int flagsMask,
    int flagsValues,
    int extraFlags,
    Bundle options
)

This method is deprecated.

void

This method is deprecated.

String

This method is deprecated.

void

This method is deprecated.

Constants

ARG_KEY

Added in 1.0.0
Deprecated in 1.1.0
protected static final String ARG_KEY = "key"

Public constructors

PreferenceDialogFragment

Added in 1.0.0
Deprecated in 1.1.0
public PreferenceDialogFragment()

Public methods

getPreference

Added in 1.0.0
Deprecated in 1.1.0
public DialogPreference getPreference()

Get the preference that requested this dialog. Available after onCreate has been called on the PreferenceFragment which launched this dialog.

Returns
DialogPreference

The DialogPreference associated with this dialog

onClick

Added in 1.0.0
Deprecated in 1.1.0
public void onClick(@NonNull DialogInterface dialog, int which)

onCreate

Added in 1.0.0
Deprecated in 1.1.0
public void onCreate(@Nullable Bundle savedInstanceState)

onCreateDialog

Added in 1.0.0
Deprecated in 1.1.0
public @NonNull Dialog onCreateDialog(@Nullable Bundle savedInstanceState)

onDialogClosed

Added in 1.0.0
Deprecated in 1.1.0
public abstract void onDialogClosed(boolean positiveResult)

onDismiss

Added in 1.0.0
Deprecated in 1.1.0
public void onDismiss(@NonNull DialogInterface dialog)

onSaveInstanceState

Added in 1.0.0
Deprecated in 1.1.0
public void onSaveInstanceState(@NonNull Bundle outState)

Protected methods

onBindDialogView

Added in 1.0.0
Deprecated in 1.1.0
protected void onBindDialogView(@NonNull View view)

Binds views in the content view of the dialog to data.

Make sure to call through to the superclass implementation.

Parameters
@NonNull View view

The content view of the dialog, if it is custom

onCreateDialogView

Added in 1.0.0
Deprecated in 1.1.0
protected @Nullable View onCreateDialogView(@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.

Returns
@Nullable View

The content view for the dialog

onPrepareDialogBuilder

Added in 1.0.0
Deprecated in 1.1.0
protected void onPrepareDialogBuilder(@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.

Do not create or show.