added in version 24.1.0
belongs to Maven artifact com.android.support:preference-v7:28.0.0-alpha1

PreferenceGroup.PreferencePositionCallback

public static interface PreferenceGroup.PreferencePositionCallback

android.support.v7.preference.PreferenceGroup.PreferencePositionCallback


Interface for PreferenceGroup Adapters to implement so that scrollToPreference(String) and scrollToPreference(Preference) or scrollToPreference(String) and scrollToPreference(Preference) can determine the correct scroll position to request.

Summary

Public methods

abstract int getPreferenceAdapterPosition(String key)

Return the adapter position of the first Preference with the specified key

abstract int getPreferenceAdapterPosition(Preference preference)

Return the adapter position of the specified Preference object

Public methods

getPreferenceAdapterPosition

added in version 24.1.0
int getPreferenceAdapterPosition (String key)

Return the adapter position of the first Preference with the specified key

Parameters
key String: Key of Preference to find

Returns
int Adapter position of the Preference or NO_POSITION if not found

getPreferenceAdapterPosition

added in version 24.1.0
int getPreferenceAdapterPosition (Preference preference)

Return the adapter position of the specified Preference object

Parameters
preference Preference: Preference object to find

Returns
int Adapter position of the Preference or NO_POSITION if not found