Sdílet prostřednictvím


NfcAdapter.DisableForegroundNdefPush(Activity) Method

Definition

Caution

deprecated

Disable NDEF message push over 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

Parameters

activity
Activity

the Foreground activity

Attributes

Exceptions

if the Activity has already been paused

Remarks

Disable NDEF message push over P2P.

After calling #enableForegroundNdefPush, an activity must call this method before its Activity#onPause callback completes.

Strongly recommend to use the new #setNdefPushMessage instead: it automatically hooks into your activity life-cycle, so you do not need to call enable/disable in your onResume/onPause.

This method must be called from the main thread.

<p class="note">Requires the android.Manifest.permission#NFC permission.

Java documentation for android.nfc.NfcAdapter.disableForegroundNdefPush(android.app.Activity).

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