SubscriptionManager.OnSubscriptionsChangedListener
public
static
class
SubscriptionManager.OnSubscriptionsChangedListener
extends Object
java.lang.Object | |
↳ | android.telephony.SubscriptionManager.OnSubscriptionsChangedListener |
A listener class for monitoring changes to SubscriptionInfo
records.
Override the onSubscriptionsChanged method in the object that extends this
class and pass it to SubscriptionManager.addOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener)
to register your listener and to unregister invoke
SubscriptionManager.removeOnSubscriptionsChangedListener(android.telephony.SubscriptionManager.OnSubscriptionsChangedListener)
Permissions android.Manifest.permission.READ_PHONE_STATE is required for #onSubscriptionsChanged to be invoked.
Summary
Public constructors | |
---|---|
OnSubscriptionsChangedListener()
Create an OnSubscriptionsChangedListener. |
Public methods | |
---|---|
void
|
onSubscriptionsChanged()
Callback invoked when there is any change to any SubscriptionInfo, as well as once on
registering for changes with |
Inherited methods | |
---|---|
Public constructors
OnSubscriptionsChangedListener
public OnSubscriptionsChangedListener ()
Create an OnSubscriptionsChangedListener.
For callers targeting Build.VERSION_CODES#P
or earlier, this can only be called
on a thread that already has a prepared Looper. Callers targeting Q or later should
subsequently use SubscriptionManager#addOnSubscriptionsChangedListener(
Executor, OnSubscriptionsChangedListener)
.
On OS versions prior to Build.VERSION_CODES#VANILLA_ICE_CREAM
callers should
assume that this call will fail if invoked on a thread that does not already have a
prepared looper.
Public methods
onSubscriptionsChanged
public void onSubscriptionsChanged ()
Callback invoked when there is any change to any SubscriptionInfo, as well as once on
registering for changes with SubscriptionManager.addOnSubscriptionsChangedListener(OnSubscriptionsChangedListener)
. Typically
this method would invoke SubscriptionManager.getActiveSubscriptionInfoList()