Leo*_*Leo 6 android intentfilter android-manifest android-intent
不确定这是否可能,但希望有人有解决方案。
我试图让我的 Android 应用程序拦截 mydomain.com/abc 但不是 mydomain.com/mp3/id 形式的网址
是否可以使用 pathPattern 以某种方式排除某些路径?
<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" />
<data android:host="mydomain.com" />
<data android:pathPattern="/.*" /> />
</intent-filter>
Run Code Online (Sandbox Code Playgroud)
pathPattern 的工作方式更像是 glob,而不是 regexp。如果你真的指的是 mydomain/abc,你应该能够指定 android:host="mydomain.com" android:pathPattern="abc",但我的猜测是你的意思是
匹配 mydomain.com/x
不匹配 mydomain/x/y
我认为这是不可能的。如果是,则可能涉及 pathPrefix 的一些使用。
| 归档时间: |
|
| 查看次数: |
2032 次 |
| 最近记录: |