I\'m trying to start a activity when my smartphone scans an NDEF message. This is my manifest:
The manifest looks pretty much ok I think. Maybe you can try adding
android:exported="true"
to the activity that should receive the NFC-scanning intent.
<activity android:name="com.example.androidbeam.ReceiverNDEFActivity" >
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED"
android:exported="true"
/>
<category android:name="android.intent.category.DEFAULT" />
<data
android:host="ext"
android:pathPrefix="/com.example:externalType"
android:scheme="vnd.android.nfc" />
</intent-filter>
</activity>
Are you using a NFC-tag to scan from?
The trick is that NFC Forum external type names are case-insensitive. However, Android's intent filter system is case-SENSITIVE. Therefore, you must always use ALL lower-case external type names in your intent filters:
<activity android:name="com.example.androidbeam.ReceiverNDEFActivity" >
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data
android:scheme="vnd.android.nfc"
android:host="ext"
android:pathPrefix="/com.example:externaltype" />
</intent-filter>
</activity>
Note that the NdefRecord.createExternal(...)
method will automatically convert all type names to lower-case spelling.