具有多个查询参数的Android深层链接 [英] Android Deep Linking with multiple query parameters

查看:152
本文介绍了具有多个查询参数的Android深层链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试深层链接我的应用程序,并在AndroidManifest.xml中实现了以下内容以打开适当的活动。

I'm trying to deep link my app and have implemented the following in my AndroidManifest.xml to open the proper activity.

<activity
    android:name=".ui.activities.MyActivity"
    android:label="@string/title_activity"
    android:screenOrientation="portrait">
    <!-- ATTENTION: This intent was auto-generated. Follow instructions at
    https://g.co/AppIndexing/AndroidStudio to publish your Android app deep links. -->
    <intent-filter>
        <action android:name="android.intent.action.VIEW" />

        <category android:name="android.intent.category.DEFAULT" />
        <category android:name="android.intent.category.BROWSABLE" />
        <!-- ATTENTION: This data URL was auto-generated. We recommend that you use the HTTP scheme.
        TODO: Change the host or pathPrefix as necessary. -->
        <data
            android:host="myHost"
            android:scheme="myCustomScheme" />
    </intent-filter>
</activity>

然后我正在使用

adb shell am start -W -a android.intent.action.VIEW -d "myCustomScheme://myHost?key=category_parent_id&value=92&title=test" com.myApp.android

该活动正在打开,但是在意图中传递给该活动的URI是仅

The Activity is opening but the URI which is passed to the activity in the intent is only

myCustomScheme://myHost?key=category_parent_id

它跳过了'&'之后的所有内容。

Its skipping everything after '&'

我确实在这里查找了,但没有找到任何东西多个查询参数。

I did look up here on SO but didn't find anything with multiple query parameters.

推荐答案

只需在<$ c之前添加 \ 用adb测试时,请使用$ c>& 符号。

Just add \ before & sign when testing with adb.

复制以下内容:

adb shell开始-W -a android.intent.action.VIEW -d myCustomScheme:// myHost?key = category_parent_id\& value = 92\& title = test com .myApp.android

这篇关于具有多个查询参数的Android深层链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆