Share via


NfcAdapter.Disable Method

Definition

Disable NFC hardware.

[Android.Runtime.Register("disable", "()Z", "", ApiSince=36)]
[Android.Runtime.RequiresPermission("android.permission.WRITE_SECURE_SETTINGS")]
public bool Disable();
[<Android.Runtime.Register("disable", "()Z", "", ApiSince=36)>]
[<Android.Runtime.RequiresPermission("android.permission.WRITE_SECURE_SETTINGS")>]
member this.Disable : unit -> bool

Returns

Attributes

Remarks

Disable NFC hardware.

No NFC features will work after this call, and the hardware will not perform or respond to any NFC communication.

This call is asynchronous. Listen for #ACTION_ADAPTER_STATE_CHANGED broadcasts to find out when the operation is complete.

This API is only allowed to be called by system apps or apps which are Device Owner or Profile Owner.

If this returns true, then either NFC is already off, or a #ACTION_ADAPTER_STATE_CHANGED broadcast will be sent to indicate a state transition. If this returns false, then there is some problem that prevents an attempt to turn NFC off.

Java documentation for android.nfc.NfcAdapter.disable().

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