我有我的android应用程序,通过DownloadService下载文件。这个文件是特殊文件格式,只能在我的应用程序中使用 - 它有后缀* .foobar。android下载管理器打开文件与我的应用程序
我开始下载这种方式:
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);
下载工作正常,但是当我的通知点击“下载完了”,我希望我的行为将被打开。我得到的是“文件无法打开”。
在我的清单中,我有一个针对.foobar文件后缀的意图过滤器。
<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>
我错过了什么吗?