简体   繁体   English

无法检测到android中nfc标签的删除

[英]Unable to detect the removal of nfc tag in android

How to check that Nfc tag is removed from my phone .After attaching the nfctag it is ready to write but when i want to detect the nfcremoval by using nfctag.isEnabled() but its not working .如何检查 Nfc 标签是否从我的手机中删除。附加 nfctag 后,它已准备好写入,但是当我想使用nfctag.isEnabled()检测 nfcremoval 但它不起作用时。 where nfctag is nfcTag.其中 nfctag 是 nfcTag。 It is showing underline below if(!nfctag.isenable()它在下面显示下划线if(!nfctag.isenable()

What's "nfctag" ?什么是“nfctag”?

Tag don't have isEnable 标签没有isEnable

NfcAdapter have a isEnable but it's to know if NFC is enabled or not on device NfcAdapter有一个isEnable但它要知道设备上是否启用了 NFC

Return true if this NFC Adapter has any features enabled.如果此 NFC 适配器启用了任何功能,则返回 true。

There's a method isConnected on TagTechnology classes NfcA NfcB IsoDep ...TagTechnologyNfcA NfcB IsoDep上有一个方法isConnected ...

isConnected已连接

Helper to indicate if I/O operations should be possible.指示 I/O 操作是否可行的助手。
Returns true if connect() has completed, and close() has not been called, and the Tag is not known to be out of range.如果 connect() 已完成,并且 close() 尚未调用,并且不知道标记超出范围,则返回 true。
Does not cause RF activity, and does not block.不会引起射频活动,也不会阻塞。

Returns true if I/O operations should be possible如果 I/O 操作应该是可能的,则返回 true

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM