I have developed an app which uses NFC function and got this TAG for my tests.
a busy cat http://nsae02.casimages.net/img/2014/11/20/mini_141120054648901134.png
and its characteristics
a busy cat http://nsae02.casimages.net/img/2014/11/20/mini_141120054925844663.png
All very well ..
and add the following lines in the config
<uses-feature android:name="android.hardware.nfc" android:required="false" />
<intent-filter>
<action android:name="android.nfc.action.TAG_DISCOVERED"/>
<action android:name="android.nfc.action.NDEF_DISCOVERED"/>
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
Add my code so that when it detects the nfc and select my app
Get the UID .. And makes it right. (Then find out if you can get the different fields such as text.) Good. It works all right ..
my app blue http://nsae02.casimages.net/img/2014/11/19/mini_141119082121303903.png
my problem is then That same edit it using NFC TAG TAG Writer application
a busy cat http://nsae02.casimages.net/img/2014/11/20/mini_141120055409818122.png
a busy cat http://nsae02.casimages.net/img/2014/11/20/mini_141120055615627271.png
And I put a text and I go back to using my app but no longer appears in the list ..
Not my app http://nsae02.casimages.net/img/2014/11/19/mini_141119081714874308.png
Giving many turns and able to reappear in my app list formatting the NFC TAG
What am I doing wrong? If I have not put enough information please ask me. thank you very much
You need to setup proper intent filters that match the type of your tag. Currently you are using
Consequently, what you experience is the fall-back behavior: While your tag does not contain an NDEF record, it will match the fall-back. As soon as you write a Text record to it, it will match all apps that registered for Text NDEF records and, therefore, won't trigger the fall-back anymore.
So, if you want to use a Text record on your tag, you could add the following intent filter for your activity:
Note that it is usually a bad idea to use Text records. First, they are meant for human-readable data only and, second, many apps register for them which makes it difficult for a user to select the right app in the activity chooser dialog.
This will still not catch the case where your tag does not contain any data (which is currently handled by the fall-back filter). In that case, you should use a TECH_DISCOVERED intent filter for the NfcV tag technology:
And in your res/xml folder you would need to create a file named filter_nfc.xml with this contents:
Or when you want to register for multiple different tag technologies: