語言

NfcAdapter.DisableForegroundNdefPush(Activity) 方法

定義

警告

deprecated

關閉 NDEF 訊息推送,透過 P2P。

[Android.Runtime.Register("disableForegroundNdefPush", "(Landroid/app/Activity;)V", "")]
[System.Obsolete("deprecated")]
public void DisableForegroundNdefPush(Android.App.Activity? activity);
[<Android.Runtime.Register("disableForegroundNdefPush", "(Landroid/app/Activity;)V", "")>]
[<System.Obsolete("deprecated")>]
member this.DisableForegroundNdefPush : Android.App.Activity -> unit

參數

activity
Activity

前景活動

屬性

例外狀況

如果活動已經被暫停

備註

關閉 NDEF 訊息推送,透過 P2P。

呼叫 #enableForegroundNdefPush後,活動必須在回調完成前呼叫此方法 Activity#onPause 。

強烈建議改用新 #setNdefPushMessage 版:它會自動連接到你的活動生命週期,所以你不需要在 onResume/onPause 裡呼叫啟用或停用。

此方法必須從主執行緒呼叫。

需要 android.Manifest.permission#NFC 權限。

Java 文件 android.nfc.NfcAdapter.disableForegroundNdefPush(android.app.Activity)。

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

適用於