2

我已经在我的应用程序中实现了深度链接。果然,当我从浏览器单击链接时,它会打开应用程序。但是当我这样做时

Intent intent = getIntent();
String action = intent.getAction();
Uri data = intent.getData();

两者actiondata为空。什么会导致这样的事情?我想它打开我的应用程序的事实意味着它有一个 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>
4

1 回答 1

4

确保你Intent从右边检查Activity

Activity例如,当您检查以下 Intent 时,您的意图过滤器已在启动时设置Activity

于 2016-07-12T06:37:31.203 回答