我正在开发一个需要与NFC标签进行深度链接的Android应用程序。
以下是该活动的意图过滤器:
以下是该活动的意图过滤器:
<activity
android:name=".ui.schedule.ScheduleActivity"
android:parentActivityName=".ui.home.HomeActivity">
<intent-filter android:label="testDeepLink">
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE"/>
<data
android:scheme="http"
android:host="www.testdeeplink.com"
android:pathPrefix="/schedule"/>
</intent-filter>
</activity>
现在当我在adb中启动此命令时,应用程序将以正确的活动(ScheduleActivity)开始:
adb shell am start -W -a android.intent.action.VIEW -d "http://www.testdeeplink.com/schedule?stop_id=1" com.exmemple.android
但是当我在NFC标签上编码URL时,扫描该标签只会启动我的手机浏览器。我错过了什么来使用NFC标签启动活动?
标签上编码的URL:"http://www.testdeeplink.com/schedule?stop_id=1"