情况:
有一个网站以这种形式列出了下载:
http://www.xyz.org/download.php?id=1234568
来自服务器的响应标头如下所示:
HTTP/1.1 200 OK
Date: Thu, 06 Sep 2012 15:14:33 GMT
Server: Apache
X-Powered-By: PHP/5.2.6-1+lenny16
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Pragma: no-cache
Content-Disposition: attachment; filename=myspecialfile.myx
Content-Length: 20269746
Last-Modified: Wed, 05 Sep 2012 17:15:01 GMT
Keep-Alive: timeout=15, max=100
Connection: Keep-Alive
Content-Type: application/my+xyz+app
如您所见,有一个特殊的内容类型应用程序/my+xyz+app
我如何为我的活动开始的清单文件编写意图过滤器,以便我可以处理下载?
这是我到目前为止所拥有的:
<activity
android:name=".ui.Library"
android:label="@string/app_name"
android:launchMode="singleTask" >
<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" android:mimeType="application/my+xyz+app" />
</intent-filter>
</activity>
感谢帮助!