Ontoshgo
Ontoshgo

Reputation: 167

Android:pathpattern for intercepting file download intents from browser

I`m trying to make something like downloadmanager and i got trouble with intent-filters. My intent filter for catching file download intents is like this:

<intent-filter>
     <action android:name="android.intent.action.VIEW" />
     <category android:name="android.intent.category.BROWSABLE" />
     <category android:name="android.intent.category.DEFAULT" />
     <data android:scheme="http" />
     <data android:scheme="https" />
     <data android:scheme="ftp" />
     <data android:scheme="file" />
     <data android:scheme="data" />
     <data android:scheme="info" />
     <data android:scheme="data" />
     <data android:scheme="smb" />
     <data android:scheme="nfs" />
     <data android:scheme="content" />
     <data android:host="*" />
     <data android:pathPattern=".*\\.avi" />
     <data android:pathPattern=".*\\.mp4" />
     ....
 </intent-filter>

is there any way to make pathpattern look like * . * and match any filetype?

Upvotes: 2

Views: 356

Answers (1)

Buurman
Buurman

Reputation: 1984

The scheme="data" line is in there twice.

Have you tried <data android:pathPattern=".*\\..*" /> ?

Be aware that you will accept any type of file which might not be what you really want for a lot of reasons. But any ways, that is it.

Upvotes: 2

Related Questions