Search in sources :

Example 51 with OnPreferenceClickListener

use of android.preference.Preference.OnPreferenceClickListener in project android_packages_apps_Dialer by LineageOS.

the class VoicemailSettingsFragment method setupVoicemailChangePinPreference.

private void setupVoicemailChangePinPreference() {
    Intent changePinIntent = new Intent(new Intent(getContext(), VoicemailChangePinActivity.class));
    changePinIntent.putExtra(VoicemailClient.PARAM_PHONE_ACCOUNT_HANDLE, phoneAccountHandle);
    voicemailChangePinPreference.setIntent(changePinIntent);
    voicemailChangePinPreference.setOnPreferenceClickListener(new OnPreferenceClickListener() {

        @Override
        public boolean onPreferenceClick(Preference preference) {
            Logger.get(getContext()).logImpression(DialerImpression.Type.VVM_CHANGE_PIN_CLICKED);
            // Let the preference handle the click.
            return false;
        }
    });
    if (VoicemailChangePinActivity.isPinScrambled(getContext(), phoneAccountHandle)) {
        voicemailChangePinPreference.setTitle(R.string.voicemail_set_pin_preference_title);
    } else {
        voicemailChangePinPreference.setTitle(R.string.voicemail_change_pin_preference_title);
    }
    updateChangePinPreference();
}
Also used : OnPreferenceClickListener(android.preference.Preference.OnPreferenceClickListener) Preference(android.preference.Preference) SwitchPreference(android.preference.SwitchPreference) Intent(android.content.Intent)

Aggregations

OnPreferenceClickListener (android.preference.Preference.OnPreferenceClickListener)51 Preference (android.preference.Preference)50 Intent (android.content.Intent)26 ListPreference (android.preference.ListPreference)21 CheckBoxPreference (android.preference.CheckBoxPreference)15 SwitchPreference (android.preference.SwitchPreference)15 DialogInterface (android.content.DialogInterface)8 SharedPreferences (android.content.SharedPreferences)8 PreferenceCategory (android.preference.PreferenceCategory)8 PreferenceScreen (android.preference.PreferenceScreen)8 EditTextPreference (android.preference.EditTextPreference)7 OnPreferenceChangeListener (android.preference.Preference.OnPreferenceChangeListener)7 AlertDialog (android.app.AlertDialog)6 Bundle (android.os.Bundle)6 Uri (android.net.Uri)5 View (android.view.View)5 OnClickListener (android.content.DialogInterface.OnClickListener)4 TextView (android.widget.TextView)4 Activity (android.app.Activity)3 NameNotFoundException (android.content.pm.PackageManager.NameNotFoundException)3