SubscriptionManager.GetActiveSubscriptionInfo(Int32) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Get the active SubscriptionInfo with the input subId.
[Android.Runtime.Register("getActiveSubscriptionInfo", "(I)Landroid/telephony/SubscriptionInfo;", "GetGetActiveSubscriptionInfo_IHandler", ApiSince=22)]
[Android.Runtime.RequiresPermission("android.permission.READ_PHONE_STATE")]
public virtual Android.Telephony.SubscriptionInfo? GetActiveSubscriptionInfo (int subId);
[<Android.Runtime.Register("getActiveSubscriptionInfo", "(I)Landroid/telephony/SubscriptionInfo;", "GetGetActiveSubscriptionInfo_IHandler", ApiSince=22)>]
[<Android.Runtime.RequiresPermission("android.permission.READ_PHONE_STATE")>]
abstract member GetActiveSubscriptionInfo : int -> Android.Telephony.SubscriptionInfo
override this.GetActiveSubscriptionInfo : int -> Android.Telephony.SubscriptionInfo
- subId
- Int32
The unique SubscriptionInfo key in database.
SubscriptionInfo, maybe null if its not active.
- Attributes
Get the active SubscriptionInfo with the input subId.
Requires Permission: android.Manifest.permission#READ_PHONE_STATE READ_PHONE_STATE
or that the calling app has carrier privileges (see TelephonyManager#hasCarrierPrivileges
).
Java documentation for android.telephony.SubscriptionManager.getActiveSubscriptionInfo(int)
.
Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.