I have my android app, that downloads a file via the DownloadService. This file is in special file format, that only can be used in my app - it has the suffix *.foobar.
I start the download this way:
DownloadManager.Request request = new DownloadManager.Request(Uri.parse(url));
request.setDestinationInExternalPublicDir("/", "aaaa.foobar");
// get download service and enqueue file
DownloadManager manager = (DownloadManager) getSystemService(Context.DOWNLOAD_SERVICE);
Download works fine, but when I tap on the notification "download finished", I want that my activity will be opened. What I get is the toast "File can not be opened".
In my Manifest I have a intent-filter for the .foobar file suffix.
<intent-filter android:label="@string/app_name">
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.DEFAULT" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="file" />
<data android:mimeType="*/*" />
<data android:pathPattern=".*\\.foobar" />
<data android:host="*" />
</intent-filter>
Am I missing something?