Stay organized with collections
Save and categorize content based on your preferences.
PreferenceFragment.OnPreferenceStartFragmentCallback
public
static
interface
PreferenceFragment.OnPreferenceStartFragmentCallback
android.preference.PreferenceFragment.OnPreferenceStartFragmentCallback
|
Known indirect subclasses
|
This interface was deprecated
in API level 28.
Use PreferenceFragmentCompat.OnPreferenceStartFragmentCallback
Interface that PreferenceFragment's containing activity should
implement to be able to process preference items that wish to
switch to a new fragment.
Summary
Public methods
onPreferenceStartFragment
public abstract boolean onPreferenceStartFragment (PreferenceFragment caller,
Preference pref)
Called when the user has clicked on a Preference that has
a fragment class name associated with it. The implementation
to should instantiate and switch to an instance of the given
fragment.
Parameters |
caller |
PreferenceFragment |
pref |
Preference |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# PreferenceFragment.OnPreferenceStartFragmentCallback\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nDeprecated in [API level\n28](/guide/topics/manifest/uses-sdk-element#ApiLevels) \nSummary: [Methods](#pubmethods) \n\nPreferenceFragment.OnPreferenceStartFragmentCallback\n====================================================\n\n*** ** * ** ***\n\n[Kotlin](/reference/kotlin/android/preference/PreferenceFragment.OnPreferenceStartFragmentCallback \"View this page in Kotlin\") \\|Java\n\n\n`\npublic\nstatic\n\n\ninterface\nPreferenceFragment.OnPreferenceStartFragmentCallback\n`\n\n\n`\n\n\n`\n\n|-------------------------------------------------------------------------|\n| android.preference.PreferenceFragment.OnPreferenceStartFragmentCallback |\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known indirect subclasses [PreferenceActivity](/reference/android/preference/PreferenceActivity) |------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| | [PreferenceActivity](/reference/android/preference/PreferenceActivity) | *This class was deprecated in API level 29. Use the [AndroidX](/jetpack/androidx) [Preference Library](/reference/androidx/preference/package-summary) for consistent behavior across all devices. For more information on using the AndroidX Preference Library see [Settings](/guide/topics/ui/settings).* | |\n\n\u003cbr /\u003e\n\n*** ** * ** ***\n\n\n**This interface was deprecated\nin API level 28.** \n\nUse [PreferenceFragmentCompat.OnPreferenceStartFragmentCallback](https://developer.android.com/reference/androidx/preference/PreferenceFragmentCompat.OnPreferenceStartFragmentCallback.html)\n\nInterface that PreferenceFragment's containing activity should\nimplement to be able to process preference items that wish to\nswitch to a new fragment.\n\nSummary\n-------\n\n| ### Public methods ||\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| ` abstract boolean` | ` `[onPreferenceStartFragment](/reference/android/preference/PreferenceFragment.OnPreferenceStartFragmentCallback#onPreferenceStartFragment(android.preference.PreferenceFragment,%20android.preference.Preference))`(`[PreferenceFragment](/reference/android/preference/PreferenceFragment)` caller, `[Preference](/reference/android/preference/Preference)` pref) ` Called when the user has clicked on a Preference that has a fragment class name associated with it. |\n\nPublic methods\n--------------\n\n### onPreferenceStartFragment\n\nAdded in [API level 11](/guide/topics/manifest/uses-sdk-element#ApiLevels) \n\n```\npublic abstract boolean onPreferenceStartFragment (PreferenceFragment caller, \n Preference pref)\n```\n\nCalled when the user has clicked on a Preference that has\na fragment class name associated with it. The implementation\nto should instantiate and switch to an instance of the given\nfragment.\n\n\u003cbr /\u003e\n\n| Parameters ||\n|----------|-----------------------------|\n| `caller` | `PreferenceFragment` \u003cbr /\u003e |\n| `pref` | `Preference` \u003cbr /\u003e |\n\n| Returns ||\n|-----------|--------|\n| `boolean` | \u003cbr /\u003e |"]]