Stay organized with collections
Save and categorize content based on your preferences.
OnOpportunisticSubscriptionsChangedListener
open class OnOpportunisticSubscriptionsChangedListener
A listener class for monitoring changes to SubscriptionInfo
records of opportunistic subscriptions.
Override the onOpportunisticSubscriptionsChanged method in the object that extends this or addOnOpportunisticSubscriptionsChangedListener(java.util.concurrent.Executor,android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener)
to register your listener and to unregister invoke removeOnOpportunisticSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener)
Permissions android.Manifest.permission.READ_PHONE_STATE is required for #onOpportunisticSubscriptionsChanged to be invoked.
Summary
Public methods |
open Unit |
Callback invoked when there is any change to any SubscriptionInfo.
|
Public constructors
OnOpportunisticSubscriptionsChangedListener
OnOpportunisticSubscriptionsChangedListener()
Public methods
onOpportunisticSubscriptionsChanged
open fun onOpportunisticSubscriptionsChanged(): Unit
Callback invoked when there is any change to any SubscriptionInfo. Typically this method would invoke getActiveSubscriptionInfoList
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,["# SubscriptionManager.OnOpportunisticSubscriptionsChangedListener\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nOnOpportunisticSubscriptionsChangedListener\n===========================================\n\n*** ** * ** ***\n\nKotlin \\|[Java](/reference/android/telephony/SubscriptionManager.OnOpportunisticSubscriptionsChangedListener \"View this page in Java\") \n\n```\nopen class OnOpportunisticSubscriptionsChangedListener\n```\n\n|---|----------------------------------------------------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||\n| ↳ | [android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener](#) |\n\nA listener class for monitoring changes to [SubscriptionInfo](/reference/kotlin/android/telephony/SubscriptionInfo) records of opportunistic subscriptions.\n\nOverride the onOpportunisticSubscriptionsChanged method in the object that extends this or [addOnOpportunisticSubscriptionsChangedListener(java.util.concurrent.Executor,android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener)](/reference/kotlin/android/telephony/SubscriptionManager#addOnOpportunisticSubscriptionsChangedListener(java.util.concurrent.Executor,%20android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener)) to register your listener and to unregister invoke [removeOnOpportunisticSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener)](/reference/kotlin/android/telephony/SubscriptionManager#removeOnOpportunisticSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnOpportunisticSubscriptionsChangedListener))\n\nPermissions android.Manifest.permission.READ_PHONE_STATE is required for #onOpportunisticSubscriptionsChanged to be invoked.\n\nSummary\n-------\n\n| Public constructors ||\n|----------------------------------------------------------------------------------------------------------|---|\n| [OnOpportunisticSubscriptionsChangedListener](#OnOpportunisticSubscriptionsChangedListener())`()` \u003cbr /\u003e |\n\n| Public methods ||\n|-----------------------------------------------------------------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------|\n| open [Unit](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-unit/index.html) | [onOpportunisticSubscriptionsChanged](#onOpportunisticSubscriptionsChanged())`()` Callback invoked when there is any change to any SubscriptionInfo. |\n\nPublic constructors\n-------------------\n\n### OnOpportunisticSubscriptionsChangedListener\n\n```\nOnOpportunisticSubscriptionsChangedListener()\n```\n\nPublic methods\n--------------\n\n### onOpportunisticSubscriptionsChanged\n\nAdded in [API level 29](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nopen fun onOpportunisticSubscriptionsChanged(): Unit\n```\n\nCallback invoked when there is any change to any SubscriptionInfo. Typically this method would invoke [getActiveSubscriptionInfoList](/reference/kotlin/android/telephony/SubscriptionManager#getActiveSubscriptionInfoList())"]]