語言

NfcFCardEmulation.RegisterSystemCodeForService(ComponentName, String) 方法

定義

註冊指定服務的系統代碼。

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

參數

service
ComponentName

服務的元件名稱

systemCode
String

待註冊的系統代碼

傳回

是否登記成功。

屬性

備註

註冊指定服務的系統代碼。

系統代碼必須介於「4000」到「4FFF」(不含「4*FF」)之間。

如果系統碼先前已註冊(無論是透過清單靜態註冊,或是透過此 API 動態註冊),則會被替換為此服務。

即使相同的系統代碼已被註冊給其他服務,此方法仍能成功註冊該系統代碼。

請注意,你只能註冊一個系統碼,該服務在與呼叫者相同的 UID 下執行。 通常這表示你需要從與服務本身相同的套件呼叫,不過 UID 也可以在使用共用 UID 的套件間共享。

Java 文件 android.nfc.cardemulation.NfcFCardEmulation.registerSystemCodeForService(android.content.ComponentName, java.lang.String)。

本頁部分內容為基於 Open Source Project 所創建與分享的作品,並依授權條款所描述的使用進行修改。

適用於