NFC disable adapter

荒凉一梦 提交于 2019-12-24 16:12:29

问题


Is it possible to disable the NFC adapter immediately after a scan within millisecs? I want to prevent duplicate scans of the same tag. I have proved though testing that the same tag can be scanned twice within millisec by hovering the phone over a tag.

I've looked at the NFC api but can't see anything that disables the adapter. My app uses the NFC statically so i don't actually use an instance of the NFC adapter class but i would change my if i could reap the benefits of disabling the adapter.


回答1:


Since you can turn it off in the system settings I would assume there should be a way to do it. It should look something like myAdapter.disable or myAdapter.disable(something) Or try this:

http://developer.android.com/reference/android/nfc/NfcAdapter.html#disableForegroundDispatch(android.app.Activity)



来源:https://stackoverflow.com/questions/17721507/nfc-disable-adapter

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!