Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/apache-kafka/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
在Android中下载文件的意图过滤器_Android_Intentfilter_Android Download Manager - Fatal编程技术网

在Android中下载文件的意图过滤器

在Android中下载文件的意图过滤器,android,intentfilter,android-download-manager,Android,Intentfilter,Android Download Manager,我正在尝试使我的应用程序显示在此屏幕中: 这样我就可以用我的应用下载文件了。。我在清单中添加了以下意图过滤器: <intent-filter> <action android:name="android.intent.action.VIEW" /> <category android:name="android.intent.category.DEFAULT" /> <data

我正在尝试使我的应用程序显示在此屏幕中:

这样我就可以用我的应用下载文件了。。我在清单中添加了以下意图过滤器:

 <intent-filter>
            <action android:name="android.intent.action.VIEW" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="application/*" android:host="*" android:pathPattern=".*.ext" />
        </intent-filter>


但这根本没有效果。。有办法吗?

要使用
android:host
android:pathPattern
,您还需要
android:scheme

尝试将
意图过滤器更改为此:

<intent-filter>
    <action android:name="android.intent.action.VIEW" />
    <category android:name="android.intent.category.DEFAULT" />
    <data android:scheme="file" /> //or content
    <data android:mimeType="*/*" />
    <data android:pathPattern=".*\\.ext" />
    <data android:host="*" />
</intent-filter>

//或内容

这不起作用。。我应该在活动或接收者中声明意图过滤器吗?是的,将其放入活动中也检查此问题和答案:,。我做了所有这些并检查了上面的问题,但仍然不起作用。还尝试将pathPattern更改为“*.ext”,但不起作用。Neither补充道,但没有起作用work@MuhammadA.Hassan:将
路径
/
路径前缀
/
路径模式
内容
一起使用没有什么意义,因为您不知道路径会是什么样子。您好!你找到了同样的解决方案吗?你找到了一个合理的解决方案吗?