学习笔记-AndroidManifest intentfilter之category,action

category指明可以被触发的方式(可能有误,初学者,不知如何表达)
category – Gives additional information about the action to execute. For example, CATEGORY_LAUNCHER means it should appear in the Launcher as a top-level application, while CATEGORY_ALTERNATIVE means it should be included in a list of alternative actions the user can perform on a piece of data.

Activities will very often need to support the CATEGORY_DEFAULT so that they can be found by Context.startActivity().

action指明activity可以进行哪些操作(不会被过滤掉)
比如取下列值:

ACTION_VIEW content://contacts/people/1 – Display information about the person whose identifier is “1”.

ACTION_DIAL content://contacts/people/1 – Display the phone dialer with the person filled in.

ACTION_VIEW tel:123 – Display the phone dialer with the given number filled in. Note how the VIEW action does what what is considered the most reasonable thing for a particular URI.

ACTION_DIAL tel:123 – Display the phone dialer with the given number filled in.

ACTION_EDIT content://contacts/people/1 – Edit information about the person whose identifier is “1”.

ACTION_VIEW content://contacts/people/ – Display a list of people, which the user can browse through. This example is a typical top-level entry into the Contacts application, showing you the list of people. Selecting a particular person to view would result in a new intent { ACTION_VIEW content://contacts/N } being used to start an activity to display that person.

Action matches if any of the given values match the Intent action; if the filter specifies no actions, then it will only match Intents that do not contain an action.

A match is based on the following rules. Note that for an IntentFilter to match an Intent, three conditions must hold: the action and category must match, and the data (both the data type and data scheme+authority+path if specified) must match (see match(ContentResolver, Intent, boolean, String) for more details on how the data fields match).

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值