public class

PreferenceManager.SimplePreferenceComparisonCallback

extends PreferenceManager.PreferenceComparisonCallback

 java.lang.Object

androidx.preference.PreferenceManager.PreferenceComparisonCallback

↳androidx.preference.PreferenceManager.SimplePreferenceComparisonCallback

Overview

A basic implementation of PreferenceManager.PreferenceComparisonCallback suitable for use with the default Preference classes. If the PreferenceScreen contains custom Preference subclasses, you must override PreferenceManager.SimplePreferenceComparisonCallback.arePreferenceContentsTheSame(Preference, Preference).

Summary

Constructors
publicSimplePreferenceComparisonCallback()

Methods
public booleanarePreferenceContentsTheSame(Preference p1, Preference p2)

public booleanarePreferenceItemsTheSame(Preference p1, Preference p2)

from java.lang.Objectclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructors

public SimplePreferenceComparisonCallback()

Methods

public boolean arePreferenceItemsTheSame(Preference p1, Preference p2)

This method will not be able to track replaced Preference objects if they do not have a unique key.

See also: Preference.setKey(String)

public boolean arePreferenceContentsTheSame(Preference p1, Preference p2)

The result of this method is only valid for the default Preference objects, and custom subclasses which do not override Preference.onBindViewHolder(PreferenceViewHolder). This method also assumes that if a preference object is being replaced by a new instance, the old instance was not modified after being removed from its containing PreferenceGroup.