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();
}
Aggregations