Aracılığıyla paylaş


SubscriptionManager.GetActiveSubscriptionInfo(Int32) Method

Definition

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

Parameters

subId
Int32

The unique SubscriptionInfo key in database.

Returns

SubscriptionInfo, maybe null if its not active.

Attributes

Remarks

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.

Applies to