private void initializeShowAlertDialogPreference ( ) { Preference preference = findPreference ( getString ( R . string . show_alert_dialog_preference_key ) ) ; preference . setOnPreferenceClickListener ( new OnPreferenceClickListener ( ) { @ Override public boolean onPreferenceClick ( final Preference preference ) { initializeAlertDialog ( ) ; alertDialog . setShowAnimation ( createRectangularRevealAnimation ( preference ) ) ; alertDialog . setDismissAnimation ( createRectangularRevealAnimation ( preference ) ) ; alertDialog . setCancelAnimation ( createRectangularRevealAnimation ( preference ) ) ; alertDialog . show ( ) ; return true ; } } ) ; }
Initializes the preference which allows to show the alert dialog .