0

How can i register my app as a downloader as shown in the screenshot below. I have tried adding below code in my manifest but didn't work.

    <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="http" />
        <data android:scheme="https" />
    </intent-filter>

enter image description here

here is my activity in manifest:

        <activity
        android:name=".modules.downloader.home.HomeActivity"
        android:theme="@style/AppTheme.NoActionBar">
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="image/*" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEND" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="text/plain" />
        </intent-filter>
        <intent-filter>
            <action android:name="android.intent.action.SEND_MULTIPLE" />
            <category android:name="android.intent.category.DEFAULT" />
            <data android:mimeType="image/*" />
        </intent-filter>

    </activity>
Zubair Rehman
  • 2,335
  • 2
  • 20
  • 25

1 Answers1

0

You need to provide MIME type as well. If you support all types of files, then you can give <data android:mimeType="*/*" />

<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:mimeType="*/*" android:scheme="http" />
    <data android:mimeType="*/*" android:scheme="https" />
</intent-filter>
Janaaaa
  • 1,346
  • 1
  • 16
  • 34
  • i tried your solution but my app is not getting listed in the chooser :( – Zubair Rehman Jul 27 '18 at 07:34
  • @ZubairRehman: Could you share the full manifest please? I assume you have the launcher intent already. – Janaaaa Jul 27 '18 at 09:32
  • https://stackoverflow.com/questions/3760276/android-intent-filter-associate-app-with-file-extension - please check the second answer from here. it is specific to mapping certain file extension but you can use wild card to make it applicable for all. – Janaaaa Jul 27 '18 at 09:36
  • i have updated my question, please have a look at the manifest. even i tried supporting images only but still its not working – Zubair Rehman Jul 28 '18 at 06:20