- activity
- foreground activity
- message
- a NDEF Message to push over NFC
Type Reason Java.Lang.IllegalStateException if the activity is not currently in the foreground
Enable NDEF message push over NFC while this Activity is in the foreground.
You must explicitly call this method every time the activity is resumed, and you must call NfcAdapter.DisableForegroundNdefPush(Android.App.Activity) before your activity completes Android.App.Activity.OnPause.
Strongly recommend to use the new NfcAdapter.setNdefPushMessage(android.nfc.NdefMessage, android.app.Activity, android.app.Activity...) instead: it automatically hooks into your activity life-cycle, so you do not need to call enable/disable in your onResume/onPause.
For NDEF push to function properly the other NFC device must support either NFC Forum's SNEP (Simple Ndef Exchange Protocol), or Android's "com.android.npp" (Ndef Push Protocol). This was optional on Gingerbread level Android NFC devices, but SNEP is mandatory on Ice-Cream-Sandwich and beyond.
This method must be called from the main thread.
Requires the NoType:android/Manifest$permission;Href=../../../reference/android/Manifest.permission.html#NFC permission.