Taal

CardEmulation.IsDefaultServiceForCategory(ComponentName, String) Method

Definition

Allows an application to query whether a service is currently the default service to handle a card emulation category.

[Android.Runtime.Register("isDefaultServiceForCategory", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "")]
public bool IsDefaultServiceForCategory(Android.Content.ComponentName? service, string? category);
[<Android.Runtime.Register("isDefaultServiceForCategory", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "")>]
member this.IsDefaultServiceForCategory : Android.Content.ComponentName * string -> bool

Parameters

service
ComponentName

The ComponentName of the service

category
String

The category

Returns

whether service is currently the default service for the category.

        &lt;p class="note"&gt;Requires the <code data-dev-comment-type="c">android.Manifest.permission#NFC</code> permission.
Attributes

Remarks

Allows an application to query whether a service is currently the default service to handle a card emulation category.

Note that if GetSelectionModeForCategory(String) returns AlwaysAsk or AskIfConflict, this method will always return false. That is because in these selection modes a default can't be set at the category level. For categories where the selection mode is AlwaysAsk or AskIfConflict, use IsDefaultServiceForAid(ComponentName, String) to determine whether a service is the default for a specific AID.

Java documentation for android.nfc.cardemulation.CardEmulation.isDefaultServiceForCategory(android.content.ComponentName, 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