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 SubscriptionManager.addOnSubscriptionsChangedListener(OnSubscriptionsChangedListener).

Inherited methods

Object clone()

Creates and returns a copy of this object.

boolean equals(Object obj)

Indicates whether some other object is "equal to" this one.

void finalize()

Called by the garbage collector on an object when garbage collection determines that there are no more references to the object.

final Class<?> getClass()

Returns the runtime class of this Object.

int hashCode()

Returns a hash code value for the object.

final void notify()

Wakes up a single thread that is waiting on this object's monitor.

final void notifyAll()

Wakes up all threads that are waiting on this object's monitor.

String toString()

Returns a string representation of the object.

final void wait(long timeoutMillis, int nanos)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait(long timeoutMillis)

Causes the current thread to wait until it is awakened, typically by being notified or interrupted, or until a certain amount of real time has elapsed.

final void wait()

Causes the current thread to wait until it is awakened, typically by being notified or interrupted.

Public constructors

OnSubscriptionsChangedListener

Added in API level 22
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

Added in API level 22
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()