Share via


NfcAdapter.SetObserveModeEnabled(Boolean) Method

Definition

Controls whether the NFC adapter will allow transactions to proceed or be in observe mode and simply observe and notify the APDU service of polling loop frames.

[Android.Runtime.Register("setObserveModeEnabled", "(Z)Z", "", ApiSince=35)]
public bool SetObserveModeEnabled (bool enabled);
[<Android.Runtime.Register("setObserveModeEnabled", "(Z)Z", "", ApiSince=35)>]
member this.SetObserveModeEnabled : bool -> bool

Parameters

enabled
Boolean

false disables observe mode to allow the transaction to proceed while true enables observe mode and does not allow transactions to proceed.

Returns

boolean indicating success or failure.

Attributes

Remarks

Controls whether the NFC adapter will allow transactions to proceed or be in observe mode and simply observe and notify the APDU service of polling loop frames. See #isObserveModeSupported() for a description of observe mode. Only the package of the currently preferred service (the service set as preferred by the current foreground application via CardEmulation#setPreferredService(Activity, ComponentName) or the current Default Wallet Role Holder android.app.role.RoleManager#ROLE_WALLET), otherwise a call to this method will fail and return false.

Java documentation for android.nfc.NfcAdapter.setObserveModeEnabled(boolean).

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