NFC broadcastreceiver problem

前端 未结 2 2019
逝去的感伤
逝去的感伤 2021-02-11 03:54

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:06

    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

提交回复
热议问题