Android 意图过滤器路径模式

Android intent-filter path pattern

我想制作可以检测这样的 url 的 intent-filter:

http://www.example.com/?p=12345

我试过这个代码:

<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="http"
                android:host="www.example.com"
                android:pathPattern="/\?p=.*"/>

        </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:host="www.example.com"
                android:pathPattern="/*"
                android:scheme="http" />
            <data
                android:host="www.example.com"
                android:pathPattern="/.*/"
                android:scheme="http" />
        </intent-filter>