0

I'm working with NFC in my Android project with java, I have set flag for nfc adapter reader to remove sound of NFC when connecting but it doesn't work. Please give some solutions for this problem, thank you so much if you can or not

NfcAdapter adapter = NfcAdapter.getDefaultAdapter(this);
    adapter.enableReaderMode(this,
            new NfcAdapter.ReaderCallback() {
                @Override
                public void onTagDiscovered(final Tag tag) {
                    // do something
                }
            },
            NfcAdapter.FLAG_READER_NFC_A |
            NfcAdapter.FLAG_READER_NFC_B |
            NfcAdapter.FLAG_READER_NFC_F |
            NfcAdapter.FLAG_READER_NFC_V |
            NfcAdapter.FLAG_READER_NFC_BARCODE |
            NfcAdapter.FLAG_READER_NO_PLATFORM_SOUNDS,
            null);
Anh Luu
  • 176
  • 1
  • 7
  • Here is an answer that works https://stackoverflow.com/a/64921434/2373819, your code does not show enough to where you have implemented this and if you have done it in the correct place. There is also a slight difference in how the callback is defined but don't know if that makes a difference. – Andrew Dec 24 '21 at 12:01
  • @Andrew thanks, I will try it. I add it in onResume as default, but with some strangely reasons, NFC show communicate fail every t put on the Tag :( – Anh Luu Dec 27 '21 at 02:55

0 Answers0