Udostępnij za pośrednictwem


SmsManager.SetSmscAddress(String) Method

Definition

Sets the SMSC address on (U)SIM.

[Android.Runtime.Register("setSmscAddress", "(Ljava/lang/String;)Z", "", ApiSince=30)]
[Android.Runtime.RequiresPermission("android.permission.MODIFY_PHONE_STATE")]
public bool SetSmscAddress (string smsc);
[<Android.Runtime.Register("setSmscAddress", "(Ljava/lang/String;)Z", "", ApiSince=30)>]
[<Android.Runtime.RequiresPermission("android.permission.MODIFY_PHONE_STATE")>]
member this.SetSmscAddress : string -> bool

Parameters

smsc
String

the SMSC address string.

Returns

true for success, false otherwise. Failure can be due modem returning an error.

Attributes

Remarks

Sets the SMSC address on (U)SIM.

<p class="note"><strong>Note:</strong> Using this method requires that your app is the default SMS application, or has android.Manifest.permission#MODIFY_PHONE_STATE permission, or has the carrier privileges.</p>

<p class="note"><strong>Note:</strong> This method will never trigger an SMS disambiguation dialog. If this method is called on a device that has multiple active subscriptions, this SmsManager instance has been created with #getDefault(), and no user-defined default subscription is defined, the subscription ID associated with this method will be INVALID, which will result in the operation being completed on the subscription associated with logical slot 0. Use #getSmsManagerForSubscriptionId(int) to ensure the operation is performed on the correct subscription. </p>

Java documentation for android.telephony.SmsManager.setSmscAddress(java.lang.String).

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