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.
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.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-02-10 UTC."],[],[],null,["# PreferenceFragment.OnPreferenceStartFragmentCallback\n\nAdded in [API level 11](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 28](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnPreferenceStartFragmentCallback\n=================================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/preference/PreferenceFragment.OnPreferenceStartFragmentCallback \"View this page in Java\") \n\n```\ninterface OnPreferenceStartFragmentCallback\n```\n\n|------------------------------------------------------------------------------|\n| [android.preference.PreferenceFragment.OnPreferenceStartFragmentCallback](#) |\n\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [PreferenceActivity](/reference/kotlin/android/preference/PreferenceActivity) |-------------------------------------------------------------------------------|----------------------------------------------------------------------------------------| | [PreferenceActivity](/reference/kotlin/android/preference/PreferenceActivity) | This is the base class for an activity to show a hierarchy of preferences to the user. | |\n\n*** ** * ** ***\n\n| **This interface was deprecated in API level 28.**\n|\n| Use\n\nInterface that PreferenceFragment's containing activity should implement to be able to process preference items that wish to switch to a new fragment.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| abstract [Boolean](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html) | [onPreferenceStartFragment](#onPreferenceStartFragment(android.preference.PreferenceFragment,%20android.preference.Preference))`(`caller:` `[PreferenceFragment](/reference/kotlin/android/preference/PreferenceFragment)!`, `pref:` `[Preference](/reference/kotlin/android/preference/Preference)!`)` 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](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onPreferenceStartFragment(\n caller: PreferenceFragment!, \n pref: Preference!\n): Boolean\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nCalled 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."]]