Android: Understanding Intent-Filters?

Instead of looking at it from your app's point of view, flip it around and look at it from the Intent side When an Intent is created, the creator has no idea what apps are on the system to handle that Intent. But the creator does know what it wants to do (e.g. , an app might want to let the user pick out a contact from somewhere on the device), and needs to reach out to other apps on the system to ask for what's desired To do this, Intents have several pieces of information attached to them. Among them are actions and categories The actions define in a general way the action the Intent wants to do, like VIEW a contact, PICK an image from the Gallery, etc The category is an additional piece of information that gives the Intent another way to differentiate itself.

For example, when a link in the browser is clicked, the Intent that is created has the BROWSABLE category attached to it So, when the OS resolves the Intent, it will look for registered Activities or BroadcastReceivers that have an intent filter that includes all of pieces of information. If the Intent specifies the PICK action, Activities that do not have an intent-filter with the PICK action will be discarded from the list of candidates to handle the Intent In this way, the combined set of action, categories, type, and (possibly) scheme associated with an Intent serve to pinpoint the set of Activities that can handle the Intent. When you set up your intent-filter in your manifest, you are telling the OS which class of Intents you can handle.

Instead of looking at it from your app's point of view, flip it around and look at it from the Intent side. When an Intent is created, the creator has no idea what apps are on the system to handle that Intent. But the creator does know what it wants to do (e.g. , an app might want to let the user pick out a contact from somewhere on the device), and needs to reach out to other apps on the system to ask for what's desired.

To do this, Intents have several pieces of information attached to them. Among them are actions and categories. The actions define in a general way the action the Intent wants to do, like VIEW a contact, PICK an image from the Gallery, etc. The category is an additional piece of information that gives the Intent another way to differentiate itself.

For example, when a link in the browser is clicked, the Intent that is created has the BROWSABLE category attached to it.So, when the OS resolves the Intent, it will look for registered Activities or BroadcastReceivers that have an intent filter that includes all of pieces of information. If the Intent specifies the PICK action, Activities that do not have an intent-filter with the PICK action will be discarded from the list of candidates to handle the Intent. In this way, the combined set of action, categories, type, and (possibly) scheme associated with an Intent serve to pinpoint the set of Activities that can handle the Intent.

When you set up your intent-filter in your manifest, you are telling the OS which class of Intents you can handle.

Useful content.............. – dhams Sep 15 at 10:02.

Instead of looking at it from your app's point of view, flip it around and look at it from the Intent side. When an Intent is created, the creator has no idea what apps are on the system to handle that Intent. But the creator does know what it wants to do (e.g. , an app might want to let the user pick out a contact from somewhere on the device), and needs to reach out to other apps on the system to ask for what's desired.

To do this, Intents have several pieces of information attached to them. Among them are actions and categories. The category is an additional piece of information that gives the Intent another way to differentiate itself.

For example, when a link in the browser is clicked, the Intent that is created has the BROWSABLE category attached to it. So, when the OS resolves the Intent, it will look for registered Activities or BroadcastReceivers that have an intent filter that includes all of pieces of information. If the Intent specifies the PICK action, Activities that do not have an intent-filter with the PICK action will be discarded from the list of candidates to handle the Intent.

In this way, the combined set of action, categories, type, and (possibly) scheme associated with an Intent serve to pinpoint the set of Activities that can handle the Intent. When you set up your intent-filter in your manifest, you are telling the OS which class of Intents you can handle.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions