Examples of using Intent filter in English and their translations into Russian
{-}
-
Official
-
Colloquial
Android URI Scheme and Intent Filter.
For more about creating intent filters, see the Intents and Intent Filters document.
You can set up an activity as the entry point for a task by giving it an intent filter with"android. intent. action.
If the intent matches an intent filter, the system starts that component and delivers it the Intent object.
Note: To receive implicit intents, you must include the CATEGORY_DEFAULT category in the intent filter.
Step one- Add the intent filters to your manifest.
The system delivers an implicit intent to your app component only if the intent can pass through one of your intent filters.
If you do not declare this category in your intent filter, no implicit intents will resolve to your activity.
If multiple intent filters are compatible, the system displays a dialog so the user can pick which app to use.
To start, you need to pick an Activity within your app that you would like to open when the URI scheme is triggered and register an intent filter for it.
To specify accepted intent data, an intent filter can declare zero or more< data> elements, as shown in the following example.
To ensure that your app is secure, always use an explicit intent when starting a Service anddon't declare intent filters for your services.
Each intent filter specifies the type of intents it accepts based on the intent's action, data, and category.
Caution: To ensure that your app is secure, always use an explicit intent when starting a Service and do not declare intent filters for your services.
An intent filter is an expression in an app's manifest file that specifies the type of intents that the component would like to receive.
For example, the Home app populates the app launcher by finding all the activities with intent filters that specify the ACTION_MAIN action and CATEGORY_LAUNCHER category.
You can declare an intent filter for your component by adding an< intent-filter> element as a child of the component's declaration element.
When you want to handle multiple kinds of intents, but only in specific combinations of action, data, and category type,then you need to create multiple intent filters.
The reverse is not necessary- the intent filter may declare more categories than are specified in the Intent and the Intent still passes.
When the system receives an implicit intent to start an activity, it searches for the best activity for the intent by comparing it to intent filters based on three aspects.
Each intent filter is defined by an< intent-filter> element in the app's manifest file, nested in the corresponding app component(such as an< activity> element).
To advertise which implicit intents your app can receive,declare one or more intent filters for each of your app components with an< intent-filter> element in your manifest file.
An intent filter of this kind causes an icon and label for the activity to be displayed in the app launcher, giving users a way to launch the activity and to return to the task that it creates any time after it has been launched.
When you declare an activity in your app's manifest, you can optionally include intent filters that declare the capabilities of the activity so it can respond to intents from other apps.
If you have an activity that can be invoked by an external entity that might use this flag, take care that the user has a independent way to get back to the task that's started,such as with a launcher icon the root activity of the task has a CATEGORY_LAUNCHER intent filter;
However, because a component may have multiple intent filters, an intent that does not pass through one of a component's filters might make it through on another filter. .
The system identifies the components that can respond to an intent by comparing the intent received to the intent filters provided in the manifest file of other apps on the device.
When you use an implicit intent, the Android system finds the appropriate component to start by comparing the contents of the intent to the intent filters declared in the manifest file of other apps on the device.