问题
I am creating an Andriod app using nfc to check in lets say the url in the tag is "http://examples.com" I want an application to open, only when I tap on that tag.
So basically I will just edit the intent filters in my mainfest. So that everytime I tap on a tag that has the url http://developer.andriod.com/index.html
the app will open
<intent-filter>
<action android:name="android.nfc.action.NDEF_DISCOVERED" />
<category android:name="android.intent.category.LAUNCHER" />
<data android:scheme="http"
android:host="developer.android.com"
android:pathPrefix="/index.html" />
</intent-filter>
回答1:
I'm not familiar with NFC, but to my point of view you should implement the following steps. You should delete from your main activity in AndroidManifest.xml intent-filter:
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
Thus, your application will be not seen in launcher. After that you should add an intent to be run from NFC (here I cannot help you how to do this).
来源:https://stackoverflow.com/questions/11257314/i-want-an-android-app-to-open-using-nfc-tag-only