intent-filter中的pathpattern不匹配#!'#!

时间:2017-11-06 14:46:36

标签: android android-intent uri intentfilter

如何在intent-filter中过滤此URl以在点击它时打开应用程序: https://www.host.com/something#!something

似乎'#'在UriMatcher中保留为通配符,在此帖子中,pathpattern与@ianhanniballake一起工作: Intent filter pathPrefix with '#' not working

我无法用'过滤它!'像这样:

<data
      android:host="www.host.com"
      android:pathPattern=".*!.*"
      android:scheme="https" />

任何想法?

1 个答案:

答案 0 :(得分:1)

#不是网址路径的一部分。它是路径和片段之间的分隔符(a.k.a。,the fragment identifier)。因此,您无法在pathPattern中对其进行过滤。无法过滤<data>元素中的片段。您需要对其余部分进行过滤。