Most visited

Recently visited

Added in API level 22

SubscriptionInfo

public class SubscriptionInfo
extends Object implements Parcelable

java.lang.Object
   ↳ android.telephony.SubscriptionInfo


订阅信息的Parcelable类。

Summary

Inherited constants

From interface android.os.Parcelable

Fields

public static final Creator<SubscriptionInfo> CREATOR

Public methods

Bitmap createIconBitmap(Context context)

创建并返回图标 Bitmap以在用户界面中表示此 SubscriptionInfo

int describeContents()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。

CharSequence getCarrierName()
String getCountryIso()
int getDataRoaming()
CharSequence getDisplayName()
String getIccId()
int getIconTint()

用于显示有关此 PhoneAccount信息的高亮颜色。

int getMcc()
int getMnc()
String getNumber()
int getSimSlotIndex()
int getSubscriptionId()
String toString()

返回对象的字符串表示形式。

void writeToParcel(Parcel dest, int flags)

将此对象平铺到一个包裹中。

Inherited methods

From class java.lang.Object
From interface android.os.Parcelable

Fields

CREATOR

Added in API level 22
Creator<SubscriptionInfo> CREATOR

Public methods

createIconBitmap

Added in API level 22
Bitmap createIconBitmap (Context context)

创建并返回图标 Bitmap以在用户界面中表示此 SubscriptionInfo

Parameters
context Context: A Context to get the DisplayMetricss from.
Returns
Bitmap A bitmap icon for this SubscriptionInfo.

describeContents

Added in API level 22
int describeContents ()

描述此Parcelable实例的封送表示中包含的特殊对象的种类。 例如,如果对象将在writeToParcel(Parcel, int)的输出中包含writeToParcel(Parcel, int) ,则此方法的返回值必须包含CONTENTS_FILE_DESCRIPTOR位。

Returns
int a bitmask indicating the set of special object types marshaled by this Parcelable object instance.

getCarrierName

Added in API level 22
CharSequence getCarrierName ()

Returns
CharSequence the name displayed to the user that identifies Subscription provider name

getCountryIso

Added in API level 22
String getCountryIso ()

Returns
String the ISO country code

getDataRoaming

Added in API level 22
int getDataRoaming ()

Returns
int the data roaming state for this subscription, either DATA_ROAMING_ENABLE or DATA_ROAMING_DISABLE.

getDisplayName

Added in API level 22
CharSequence getDisplayName ()

Returns
CharSequence the name displayed to the user that identifies this subscription

getIccId

Added in API level 22
String getIccId ()

Returns
String the ICC ID.

getIconTint

Added in API level 22
int getIconTint ()

用于显示有关此 PhoneAccount信息的高亮颜色。

Returns
int A hexadecimal color value.

getMcc

Added in API level 22
int getMcc ()

Returns
int the MCC.

getMnc

Added in API level 22
int getMnc ()

Returns
int the MNC.

getNumber

Added in API level 22
String getNumber ()

Returns
String the number of this subscription.

getSimSlotIndex

Added in API level 22
int getSimSlotIndex ()

Returns
int the slot index of this Subscription's SIM card.

getSubscriptionId

Added in API level 22
int getSubscriptionId ()

Returns
int the subscription ID.

toString

Added in API level 22
String toString ()

返回对象的字符串表示形式。 通常, toString方法返回一个字符串,用于“文本地表示”此对象。 结果应该是一个简洁但内容丰富的表述,对于一个人来说很容易阅读。 建议所有子类重写此方法。

ObjecttoString方法返回一个字符串,其中包含对象为实例的类的名称,符号字符“ @ ”以及对象的哈希代码的无符号十六进制表示形式。 换句话说,这个方法返回一个字符串,其值等于:

 getClass().getName() + '@' + Integer.toHexString(hashCode())
 

Returns
String a string representation of the object.

writeToParcel

Added in API level 22
void writeToParcel (Parcel dest, 
                int flags)

将此对象平铺到一个包裹中。

Parameters
dest Parcel: The Parcel in which the object should be written.
flags int: Additional flags about how the object should be written. May be 0 or PARCELABLE_WRITE_RETURN_VALUE.

Hooray!