android – 如何仅使用intent过滤器过滤特定的URL

我想过滤特定网址:http://gaapa.cz/mobile/ *

但是这个过滤器会在每个URl上被触发 – ehta错了吗?

<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="gaapa.cz"
                android:path="/mobile/.*"
                android:scheme="http" />
</intent-filter>

解决方法:

根据the docs here.,您要使用path,pathPrefix或pathPattern

在您的情况下,pathPattern或pathPrefix将工作,

pathPattern="mobile/*"

要么

pathPrefix="mobile"

但是,这并不能解释为什么您的过滤器匹配所有URI.它应该匹配none,因为路径不理解“*”.我怀疑代码中的其他地方有添加/缺失的内容.

相关文章

Android性能优化——之控件的优化 前面讲了图像的优化,接下...
前言 上一篇已经讲了如何实现textView中粗字体效果,里面主要...
最近项目重构,涉及到了数据库和文件下载,发现GreenDao这个...
WebView加载页面的两种方式 一、加载网络页面 加载网络页面,...
给APP全局设置字体主要分为两个方面来介绍 一、给原生界面设...
前言 最近UI大牛出了一版新的效果图,按照IOS的效果做的,页...