NfcAdapter.ActionNdefDiscovered Field

Definition

Intent to start an activity when a tag with NDEF payload is discovered.

[Android.Runtime.Register("ACTION_NDEF_DISCOVERED")]
public const string ActionNdefDiscovered;
[<Android.Runtime.Register("ACTION_NDEF_DISCOVERED")>]
val mutable ActionNdefDiscovered : string

Field Value

Attributes

Remarks

Intent to start an activity when a tag with NDEF payload is discovered.

The system inspects the first NdefRecord in the first NdefMessage and looks for a URI, SmartPoster, or MIME record. If a URI or SmartPoster record is found the intent will contain the URI in its data field. If a MIME record is found the intent will contain the MIME type in its type field. This allows activities to register IntentFilters targeting specific content on tags. Activities should register the most specific intent filters possible to avoid the activity chooser dialog, which can disrupt the interaction with the tag as the user interacts with the screen.

If the tag has an NDEF payload this intent is started before #ACTION_TECH_DISCOVERED. If any activities respond to this intent neither #ACTION_TECH_DISCOVERED or #ACTION_TAG_DISCOVERED will be started.

The MIME type or data URI of this intent are normalized before dispatch - so that MIME, URI scheme and URI host are always lower-case.

Java documentation for android.nfc.NfcAdapter.ACTION_NDEF_DISCOVERED.

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