I want to get the Tag type... so i used the code like
Tag myTag = (Tag) nfcintent.getParcelableExtra(NfcAdapter.EXTRA_TAG);
Ndef ndefTag = Ndef.get(myTag);
String NFCType =ndefTag.getType();
the result comes like NFCType= org.nfcforum.ndef.type2
but i want to show result as 'NFC_FORUM_TYPE_2.
Thanks in advance
The possible return values of Ndef.getType()
are:
"org.nfcforum.ndef.type1"
"org.nfcforum.ndef.type2"
"org.nfcforum.ndef.type3"
"org.nfcforum.ndef.type4"
"com.nxp.ndef.mifareclassic"
"com.nxp.ndef.icodesli"
If you want anything else than this, you will have to define that yourself (eg using a HashMap
), based on these return values.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.