Skip to content Skip to sidebar Skip to footer

How Do I Permit The Android Browser To Download Files Of A Particular Extension?

I want to have the default android browser be able to download files of a particular file extension, .xyz, for example. Without installing Astro (or some other file manager), users

Solution 1:

Add the appropriate entries to the manifest for you to respond to ACTION_VIEWIntents for that type of file. For example, this filter is for an activity that can view PDF files:

<intent-filter><actionandroid:name="android.intent.action.VIEW" /><categoryandroid:name="android.intent.category.DEFAULT" /><categoryandroid:name="android.intent.category.BROWSABLE" /><dataandroid:mimeType="application/pdf" /></intent-filter>

With an appropriate <data> element, you could literally watch for .xyz files, though I think it will be better if you can watch for a MIME type instead.

Post a Comment for "How Do I Permit The Android Browser To Download Files Of A Particular Extension?"