public interface

Preference.SummaryProvider<T extends Preference>

 androidx.preference.Preference.SummaryProvider<T>

Subclasses:

EditTextPreference.SimpleSummaryProvider, ListPreference.SimpleSummaryProvider

Overview

Interface definition for a callback to be invoked when the summary of this Preference is requested (typically when this preference is added to the hierarchy or its value is updated). Implement this to allow dynamically configuring a summary.

If a SummaryProvider is set, Preference.setSummary(CharSequence) will throw an exception, and any existing value for the summary will not be used. The value returned by the SummaryProvider will be used instead whenever Preference.getSummary() is called on this preference.

Simple implementations are provided for EditTextPreference and ListPreference. To enable these implementations, use Preference.setSummaryProvider(Preference.SummaryProvider) with EditTextPreference.SimpleSummaryProvider.getInstance() or ListPreference.SimpleSummaryProvider.getInstance().

Summary

Methods
public java.lang.CharSequenceprovideSummary(Preference preference)

Called whenever Preference.getSummary() is called on this preference.

Methods

public java.lang.CharSequence provideSummary(Preference preference)

Called whenever Preference.getSummary() is called on this preference.

Parameters:

preference: This preference

Returns:

A CharSequence that will be displayed as the summary for this preference