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,["# PreferenceManager.OnActivityDestroyListener\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \nDeprecated in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnActivityDestroyListener\n=========================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/preference/PreferenceManager.OnActivityDestroyListener \"View this page in Java\") \n\n```\ninterface OnActivityDestroyListener\n```\n\n|---------------------------------------------------------------------|\n| [android.preference.PreferenceManager.OnActivityDestroyListener](#) |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Direct Subclasses [DialogPreference](/reference/kotlin/android/preference/DialogPreference) |---------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------| | [DialogPreference](/reference/kotlin/android/preference/DialogPreference) | A base class for [Preference](/reference/kotlin/android/preference/Preference) objects that are dialog-based. | |\n\n|-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| Known Indirect Subclasses [EditTextPreference](/reference/kotlin/android/preference/EditTextPreference), [ListPreference](/reference/kotlin/android/preference/ListPreference), [MultiSelectListPreference](/reference/kotlin/android/preference/MultiSelectListPreference) |---------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------| | [EditTextPreference](/reference/kotlin/android/preference/EditTextPreference) | A [Preference](/reference/kotlin/android/preference/Preference) that allows for string input. | | [ListPreference](/reference/kotlin/android/preference/ListPreference) | A [Preference](/reference/kotlin/android/preference/Preference) that displays a list of entries as a dialog. | | [MultiSelectListPreference](/reference/kotlin/android/preference/MultiSelectListPreference) | A [Preference](/reference/kotlin/android/preference/Preference) that displays a list of entries as a dialog. | |\n\n*** ** * ** ***\n\n| **This interface was deprecated in API level 29.**\n|\n| Use the [AndroidX](https://developer.android.com/jetpack/androidx.html) [Preference Library](https://developer.android.com/reference/androidx/preference/package-summary.html) for consistent behavior across all devices. For more information on using the AndroidX Preference Library see [Settings](https://developer.android.com/guide/topics/ui/settings.html).\n\nInterface definition for a class that will be called when the container's activity is destroyed.\n\nSummary\n-------\n\n| Public methods ||\n|---------------------------------------------------------------------------------------|-------------------------------------------------------------------------|\n| abstract [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onActivityDestroy](#onActivityDestroy())`()` See Activity's onDestroy. |\n\nPublic methods\n--------------\n\n### onActivityDestroy\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nabstract fun onActivityDestroy(): Unit\n```\n\n**Deprecated:** *Deprecated in Java.*\n\nSee Activity's onDestroy."]]