0

I got a plastic card with an NFC tag of unknown type, when I touch my Nexus 7 with it a short sound is playing, nothing more. I was curious if I can react to NFC tags from my app, so I declared the following filters for my Activity since I don't know the type of the Tag:

 <intent-filter>
            <action android:name="android.intent.action.MAIN" />
    <action android:name="android.nfc.action.NDEF_DISCOVERED" />
            <action android:name="android.nfc.action.TECH_DISCOVERED" />
            <action android:name="android.nfc.action.TAG_DISCOVERED" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

But it does nothing when I touch the tag. It also does not react to an XPERIA smart tag. What am I missing? Can detect NFC tags without knowing the type of the tag? I mean perform the same simple action (like setting a text) when a tag touch is detected.

1 Answer 1

1

Instead of <category android:name="android.intent.category.LAUNCHER" /> you need to use <category android:name="android.intent.category.DEFAULT"/>.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.