我已经在我的应用程序中实现了深度链接。果然,当我从浏览器单击链接时,它会打开应用程序。但是当我这样做时
Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();
两者action
都data
为空。什么会导致这样的事情?我想它打开我的应用程序的事实意味着它有一个 uri。
这是我的意图过滤器
<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:host="www.mywebsite.com"
android:scheme="http"/>
<data
android:host="www.mywebsite.com"
android:scheme="https"/>
<data
android:host="mywebsite.com"
android:scheme="http"/>
<data
android:host="mywebsite.com"
android:scheme="https"/>
<data
android:host="/*"
android:scheme="mywebsite"/>
</intent-filter>