- activity
- the current foreground Activity that has registered data to share
Documentation for this section has not yet been entered.
Manually invoke Android Beam to share data.
The Android Beam animation is normally only shown when two NFC-capable devices come into range. By calling this method, an Activity can invoke the Beam animation directly even if no other NFC device is in range yet. The Beam animation will then prompt the user to tap another NFC-capable device to complete the data transfer.
The main advantage of using this method is that it avoids the need for the user to tap the screen to complete the transfer, as this method already establishes the direction of the transfer and the consent of the user to share data. Callers are responsible for making sure that the user has consented to sharing data on NFC tap.
Note that to use this method, the passed in Activity must have already set data to share over Beam by using method calls such as NfcAdapter.setNdefPushMessageCallback(android.nfc.NfcAdapter.CreateNdefMessageCallback, android.app.Activity, android.app.Activity...) or NfcAdapter.SetBeamPushUrisCallback(.ICreateBeamUrisCallback, Android.App.Activity).