0

This question's context starts when implementing the solution described in the tremendously useful answers to this question. I ended up writing different code for phones with Android 4.4 (using enableReaderMode and for earlier versions (using enableForegroundDispatch).

After my app finishes its interactions with the card, I have observed two different behaviors:

  • When using enableForegroundDispatch, no NFC interaction happens between phone and card until the user removes the card from the phone and brings it close again.
  • When using enableReaderMode, as soon as the Activity where I coded the phone-card interactions finishes, the phone tries to read the card again: either other app starts (if it has subscribed to NFC events) or the phone plays an annoying sound (NFC card detected but no app is listening to that event). This is quite undesirable, degrading the user experience - before he/she has had the time to remove the card, something else is happening.

Is there a way to set enableReaderMode so that the phone behaves like enableForegroundDispatch?

Community
  • 1
  • 1
mictter
  • 1,358
  • 1
  • 10
  • 13
  • Can you give your the source of your `enableReaderMode` function? – S.Pols Sep 21 '14 at 08:05
  • It is one of the methods of the standard API class `NfcAdapter`, the documentation is here: http://developer.android.com/reference/android/nfc/NfcAdapter.html#enableReaderMode(android.app.Activity, android.nfc.NfcAdapter.ReaderCallback, int, android.os.Bundle) – mictter Sep 21 '14 at 11:25

0 Answers0