I have been working on nfc samples for Peer-To-Peer
mode. I have implemented onResume
method in two different way, for initiator mode and target mode as below:
For Initiator Mode:
mAdapter.setNdefPushMessage(getTestNdefMessage(), this);
and For Target Mode:
mAdapter.enableForgroundDispatch(this, pendingIntent, null, null);
I made one android phone as an initiator and other as target and put them back to back. Here, I can listen NFC device detection sound but does not receive any call to onNewIntent
on the android phone set as Target Mode.
Can anybody help me where I am wrong, in concept OR in implementation. If I enable Android NFC Beam
from settings
than I get notification on Initiator
device for Touch to Beam
. In this case I get a call to onNewIntent
.
Any direction will be helpful.