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).