2013年3月27日星期三

queryBroadcastReceivers ACTION_MEDIA_MOUNTED

ACTION_MEDIA_MOUNTED等一系列与external media状态有关的broadcast actions都需要在intent-filter中设置scheme为file。

要查询这些事件的receiver,queryBroadcastReceivers的参数intent也必须匹配data的scheme属性.

implicit intents需要匹配:(参见intent 以及 intents-filters)

1.action
2.data (both URI and data type)
3.category

其中data的uri格式是:
scheme://host:port/path

在ACTION_MEDIA_*事件中,scheme为"file",host和port省略,path是external media的路径。

没有评论:

发表评论