I want to launch my application by scanning an NFC tag containing an Android Application Record. However, this app shouldn't have a launcher icon, so I can't use CATEGORY_LAUNCHER
.
My problem is that if I comment out the CATEGORY_LAUNCHER
line in the manifest, the app is not launched anymore (a search is performed on Google Play instead):
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="app.my">
<application android:label="@string/app_name">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<!--<category android:name="android.intent.category.LAUNCHER" />-->
</intent-filter>
</activity>
</application>
</manifest>
I also tried adding the following intent filter but with no luck:
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.DEFAULT" />
<data android:mimeType="text/plain" />
</intent-filter>
What should I do to make it work? Should I add code in MainActivity
to handle the NDEF_DISCOVERED
intent?
activity
in the manifest for AAR to work. – Bruno Parmentierfinish()
. – naschNdefRecord.createApplicationRecord("app.my")
). – Bruno Parmentier