How can I list an application to download files?

I want to download files from a browser through my application. I am trying to list my application in a dialog box complete action using. It shows for other actions, such as view files, etc., but in the case of download files it does not appear in the dialog box. How can I list my application as in the picture?

I 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="*/*"/>

example image

+4
source share
3 answers

I did this by adding these filters, and now it works for all cases.

 <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>
+1
source

add these two tags to your tag <intent-filter>

<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
0
source

All Articles