Android Intent-从url首次加载时未找到附加项
我正试图通过深度链接从网页加载我的应用程序 我正在使用window.location在点击网页时调用意图url 应用程序可以通过以下方式正常打开:Android Intent-从url首次加载时未找到附加项,android,android-intent,Android,Android Intent,我正试图通过深度链接从网页加载我的应用程序 我正在使用window.location在点击网页时调用意图url 应用程序可以通过以下方式正常打开: 窗口位置(“intent://open/#Intent;scheme=testapp;package=gb.testapp.testapp;S.id=3026;end”)然而,我试图传递的id似乎只有在URL再次加载时才会出现 我在androidmanifest.xml中的意图是: <intent-filter> <acti
窗口位置(“intent://open/#Intent;scheme=testapp;package=gb.testapp.testapp;S.id=3026;end”)代码>然而,我试图传递的id似乎只有在URL再次加载时才会出现
我在androidmanifest.xml中的意图是:
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="testapp" android:host="open" android:path="/" />
</intent-filter>
这导致:
应用程序安装后首次打开url:
System.out﹕ URLLOAD - testApp://open/
System.out﹕ URLLOAD - NO PARAMS
再次打开URL
I/System.out﹕ URLLOAD - testApp://open/?id=3026
I/System.out﹕ URLLOAD - FOUND PARAMS
有没有人遇到过类似的问题,或者可以看到我的代码有问题
谢谢,
Simon我的猜测是,在您第一次启动Acivity(应用程序)时,将调用onCreate()方法,而不是onNewIntent()。对于所有后续调用,您的活动都会通过onNewIntent方法进行“更新”。使用intent
参数,而不是getIntent()
正在调用的方法-每次它都会输出log.i(),只是没有检测到任何参数已通过onCreate中的intent是否有任何参数?
I/System.out﹕ URLLOAD - testApp://open/?id=3026
I/System.out﹕ URLLOAD - FOUND PARAMS