关于CATEGORY_BROWSABLE的应用(很NB的一个运用)
关于CATEGORY_BROWSABLE的使用(很NB的一个运用)
browsable的意思就是浏览器在特定条件下可以打开你的activity,比如:
我有一个activity,它注册了能显示pdf文档,AndroidManifest.xml内容如下:
<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/pdf"/>
</intent-filter>
你在浏览器中输入
http://www.devdiv.com/1.pdf
,那么这个activity自动被浏览器给调起来。
类似我们注册了一个数据类型,指定默认打开这个数据类型的应用程序
例子程序:http://code.google.com/p/opensudoku-android/