问题
I want to develop an android program that write to the payload of an nfc tag,then read back the tag information after writing command to verify the writing. However, It seems like it need to remove and re-enter the tag to the NFC field to refresh the intent in order to read back writing information. Is that possible to implement that within one touch?
Or anyone knows the detail process in background that explain why I need second touch to read back? As far as I know, android devices are querying for NFC tags when the screen is unlocked, does that mean it will keep reading tag in the NFC field?
Thanks in advance!
回答1:
There is no need for a second touch. When writeNdefMessage() does not throw any exception, the writing was successful. If you really want to check the result, you can call getNdefMessage() to read the current contents from the tag.
来源:https://stackoverflow.com/questions/12150062/android-read-back-the-tag-infomation-after-write-without-second-touch-of-tag