次の方法で共有


Telephony.Sms.GetDefaultSmsPackage(Context) Method

Definition

Used to determine the currently configured default SMS package.

[Android.Runtime.Register("getDefaultSmsPackage", "(Landroid/content/Context;)Ljava/lang/String;", "")]
public static string? GetDefaultSmsPackage (Android.Content.Context? context);
[<Android.Runtime.Register("getDefaultSmsPackage", "(Landroid/content/Context;)Ljava/lang/String;", "")>]
static member GetDefaultSmsPackage : Android.Content.Context -> string

Parameters

context
Context

context of the requesting application

Returns

package name for the default SMS package or null

Attributes

Remarks

Used to determine the currently configured default SMS package.

As of Android 11 apps will need specific permission to query other packages. To use this method an app must include in their AndroidManifest: <queries> <intent> "android.provider.Telephony.SMS_DELIVER"/> </intent> </queries> Which will allow them to query packages which declare intent filters that include the <c>android.provider.Telephony.Sms.Intents#SMS_DELIVER_ACTION</c> intent.

Java documentation for android.provider.Telephony.Sms.getDefaultSmsPackage(android.content.Context).

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