NFC broadcastreceiver problem

前端 未结 2 614
孤城傲影
孤城傲影 2021-02-11 03:53

I want my app to listen to nfc tags only when is activated. For this I tried to register an nfc listener as following, without any success.

IntentFilter filter          


        
2条回答
  •  无人及你
    2021-02-11 04:13

    If you do not want to use foreground mode, your can always programmatically enable or disable intent filters.

    The NDEF Tools for Android project has working sample using foreground mode, also detects

    1. NFC device support
    2. NFC enabled / disabled on activity launch, or later changed
    3. NFC push enabled / disabled on activity launch, or later changed

提交回复
热议问题