简体   繁体   中英

Android NFC intent not being “called”

I have an intent filter set up so that when ever any NFC tech is discovered it calls my activity. This works great when testing with my nexus 7, however when I tried it with my nexus 4 its not working. It makes the noise as if the tag was discovered but there is no app to handle it.

The intent is as fallows.

<activity
        android:name=".NfcScanned"
        android:label="@string/title_activity_nfc_scanned" >
 <!-- Add a technology filter -->
 <intent-filter>
     <action android:name="android.nfc.action.TECH_DISCOVERED" />
      <category android:name="android.intent.category.DEFAULT" />
 </intent-filter>

 <meta-data android:name="android.nfc.action.TECH_DISCOVERED"
     android:resource="@xml/filter_nfc"
 />

Now I could post everything that is in my activity that handles the card scanning however it doesn't get that far, and it works perfectly with another device.

As far as logcat I'm getting this somewhat intriguing error

01-23 00:16:02.343: E/BrcmNfcJni(894): nativeNfcTag_doDisconnect: tag already deactivated

Nexus 4 has a Broadcom NFC chip which does not support your NXP proprietary tag type. On the other hand, NXP's NFC chip in the Nexus 7 does support the NXP proprietary tag reading.

Cf What NFC tags does the Nexus 7 Support? (2012)

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.

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