【问题标题】:Intent-Filter cannot open both http and contentIntent-Filter 无法同时打开 http 和内容
【发布时间】:2013-03-11 08:53:26
【问题描述】:

我似乎无法让我的intent-filter 同时从httpcontent 方案打开。我有我的intent-filter 设置来查找某个文件扩展名(例如:“.riley”),但是当我将我的data 部分设置为同时查找http 方案和content 方案时,它拒绝通过http打开它。当我将其设置为仅查找 http 时,它不会以 content 打开。当我没有指定scheme 时,它只通过filecontent 打开,而忽略http

这是我没有指定 scheme 的基本设置:

<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />

<data
    android:host="*"
    android:mimeType="*/*"
    android:pathPattern=".*\\.riley" />

如何获得从指定路径扩展打开我的应用程序的权限?

【问题讨论】:

    标签: android android-intent intentfilter


    【解决方案1】:

    您可以尝试使用多个意图过滤器,而不是在数据标签中定义这两个方案。

    我遇到了类似的问题,可以通过使用Intent Intercept app 并检查意图的哪些部分不匹配来解决它。 我发现应用程序在通过内容方案打开意图时往往会省略文件扩展名,这也可能是您的问题的一部分。

    【讨论】:

    • 是的。这是正确的答案。昨天我不得不发布另一个更彻底的问题。 21号你在哪里?! ;) 谢谢!
    • Here is the question that I mentioned above, for the sake of future googlers。您还可以添加多个intnent-filters 的示例供任何人搜索吗?我认为这将决定赞成票:)
    • 啊。我只是为你做的。这样更容易!但是对这个问题投票总是有礼貌的! ;)
    猜你喜欢
    • 2020-03-29
    • 1970-01-01
    • 1970-01-01
    • 2011-03-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2013-11-18
    • 1970-01-01
    相关资源
    最近更新 更多