深层链接由应用打开,但不加载URL(网页)

时间:2019-12-17 20:06:58

标签: java android android-intent deep-linking intentfilter

我使用具有 web_view 活动的应用程序链接助手工具添加了许多不同的URL。默认情况下,Android在我的 web_view 活动中添加了一些逻辑来处理意图,但这还不完整。支持的链接随应用程序打开,但不会加载。

这是清单文件的意图过滤器代码。如何在我的 web_view 活动中处理此意图?

<activity android:name="com.shop.web_view">
            <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="https"
                    android:host="flipkart.com" />
            </intent-filter>
            <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="https"
                    android:host="amazon.in" />
            </intent-filter>
            <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="https"
                    android:host="snapdeal.com" />
            </intent-filter>
        </activity>

这是自动生成的Java代码

// ATTENTION: This was auto-generated to handle app links.

    Intent appLinkIntent = getIntent();
    String appLinkAction = appLinkIntent.getAction();
    Uri appLinkData = appLinkIntent.getData();

0 个答案:

没有答案