Compartilhar via


NfcFCardEmulation.SetNfcid2ForService(ComponentName, String) Method

Definition

Set a NFCID2 for the specified service.

[Android.Runtime.Register("setNfcid2ForService", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "", ApiSince=24)]
public bool SetNfcid2ForService (Android.Content.ComponentName? service, string? nfcid2);
[<Android.Runtime.Register("setNfcid2ForService", "(Landroid/content/ComponentName;Ljava/lang/String;)Z", "", ApiSince=24)>]
member this.SetNfcid2ForService : Android.Content.ComponentName * string -> bool

Parameters

service
ComponentName

The component name of the service

nfcid2
String

The NFCID2 to be registered

Returns

whether the setting was successful.

Attributes

Remarks

Set a NFCID2 for the specified service.

The NFCID2 must be in range from "02FE000000000000" to "02FEFFFFFFFFFFFF".

If a NFCID2 was previously set for this service (either statically through the manifest, or dynamically by using this API), it will be replaced.

Note that you can only set the NFCID2 for a service that is running under the same UID as the caller of this API. Typically this means you need to call this from the same package as the service itself, though UIDs can also be shared between packages using shared UIDs.

Java documentation for android.nfc.cardemulation.NfcFCardEmulation.setNfcid2ForService(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