Language

CardEmulation.INfcEventCallback.OnPreferredServiceChanged(Boolean) Method

Definition

This method is called when this package gains or loses preferred NFC service status.

[Android.Runtime.Register("onPreferredServiceChanged", "(Z)V", "GetOnPreferredServiceChanged_ZHandler:Android.Nfc.CardEmulators.CardEmulation/INfcEventCallback, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=36)]
public virtual void OnPreferredServiceChanged(bool isPreferred);
[<Android.Runtime.Register("onPreferredServiceChanged", "(Z)V", "GetOnPreferredServiceChanged_ZHandler:Android.Nfc.CardEmulators.CardEmulation/INfcEventCallback, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null", ApiSince=36)>]
abstract member OnPreferredServiceChanged : bool -> unit
override this.OnPreferredServiceChanged : bool -> unit

Parameters

isPreferred
Boolean

true is this service has become the preferred NFC service, false if it is no longer the preferred service

Attributes

Remarks

This method is called when this package gains or loses preferred NFC service status. This can happen by way of either it becoming the default wallet role holder (see RoleManager.ROLE_WALLET) or the preferred service of the foreground activity, set with setPreferredService(Activity,ComponentName).

Android reference for android.nfc.cardemulation.CardEmulation.NfcEventCallback.onPreferredServiceChanged.

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