如何列出要下载文件的应用程序? [英] How can I list my app for download files?

查看:88
本文介绍了如何列出要下载文件的应用程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想通过我的应用程序从浏览器下载文件。我试图使用对话框在完成操作中列出我的应用程序。它会显示其他操作,例如查看文件等,但如果是下载文件,则不会显示在对话框中。

I want to download files from browser through my application. I am trying to list my app in complete action using dialog. It shows for other action like view files, etc but in case of download files it doesn't show in dialog. how can i list my app like in the image?

我在活动中使用了这些过滤器

I have used these filters in my activity

<intent-filter> <action android:name="android.intent.action.SEND" /> <action android:name="android.intent.action.VIEW"/> <category android:name="android.intent.category.OPENABLE"/> <category android:name="android.intent.category.BROWSABLE"/> <category android:name="android.intent.category.DEFAULT"/> <data android:mimeType="*/*"/>

推荐答案

我已经完成了

 <intent-filter>
            <action
                android:name="android.intent.action.MAIN"/>
            <category
                android:name="android.intent.category.DEFAULT"/>
            <category
                android:name="android.intent.category.LAUNCHER"/>
            <category
                android:name="android.intent.category.BROWSABLE"/>
            <category
                android:name="android.intent.category.APP_BROWSER"/>
            <category
                android:name="android.intent.category.NOTIFICATION_PREFERENCES"/>
        </intent-filter>
        <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="googlechrome"/>
            <data
                android:scheme="http"/>
            <data
                android:scheme="https"/>
            <data
                android:scheme="about"/>
            <data
                android:scheme="javascript"/>
        </intent-filter>
        <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="googlechrome"/>
            <data
                android:scheme="http"/>
            <data
                android:scheme="https"/>
            <data
                android:scheme="about"/>
            <data
                android:scheme="content"/>
            <data
                android:scheme="javascript"/>
            <data
                android:mimeType="text/html"/>
            <data
                android:mimeType="text/plain"/>
            <data
                android:mimeType="application/xhtml+xml"/>
        </intent-filter>
        <intent-filter>
            <action
                android:name="android.intent.action.VIEW"/>
            <category
                android:name="android.intent.category.DEFAULT"/>
            <data
                android:mimeType="multipart/related"
                android:scheme="file"/>
        </intent-filter>
        <intent-filter>
            <action
                android:name="android.intent.action.MEDIA_SEARCH"/>
            <category
                android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
        <intent-filter>
            <action
                android:name="android.speech.action.VOICE_SEARCH_RESULTS"/>
            <category
                android:name="android.intent.category.DEFAULT"/>
        </intent-filter>
        <intent-filter
            android:priority="-101">
            <action
                android:name="android.nfc.action.NDEF_DISCOVERED"/>
            <category
                android:name="android.intent.category.DEFAULT"/>
            <data
                android:scheme="http"/>
            <data
                android:scheme="https"/>
        </intent-filter>
        <intent-filter>
            <action
                android:name="android.intent.action.SEARCH"/>
        </intent-filter>
        <intent-filter>
            <action
                android:name="com.sec.android.airview.HOVER"/>
        </intent-filter>

这篇关于如何列出要下载文件的应用程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆