public static interface NfcAdapter.CreateNdefMessageCallback
Implement this interface and pass it to
setNdefPushMessageCallback() in order to create an
NdefMessage at the moment that another device is within range for NFC. Using this
callback allows you to create a message with data that might vary based on the
content currently visible to the user. Alternatively, you can call
setNdefPushMessage() if the
NdefMessage always contains the
NdefMessage createNdefMessage(NfcEvent event)
This callback is usually made on a binder thread (not the UI thread).
Called when this device is in range of another device that might support NDEF push. It allows the application to create the NDEF message only when it is required.
NDEF push cannot occur until this method returns, so do not block for too long.
The Android operating system will usually show a system UI on top of your activity during this time, so do not try to request input from the user to complete the callback, or provide custom NDEF push UI. The user probably will not see it.