When Android is given an intent, it has to figure out which activity, or activities, are able to handle it. This process is known as intent resolution.
When the intent is explicit, the intent resolution easily figures out which component the intent is directed at.
But when we use an implicit intent.Android uses the information in the intent to figure out which components are able to receive it. It does this by checking the intent filters in every app’s copy of AndroidManifest.xml.
An intent filter specifies what types of intent each component can receive.
Example:
<activity android:name="ShareActivity">
<intent-filter>
<action android:name="android.intent.action.SEND"/>
<category android:name="android.intent.category.DEFAULT"/>
<data android:mimeType="text/plain"/>
<data android:mimeType="image/*"/>
</intent-filter>
</activity>
Here’s the entry for an activity that can handle an action of ACTION_SEND. The activity is able to accept data with MIME types of text/plain or image.
The intent filter also specifies a category. The category supplies extra information about the activity such as whether it can be started by a web browser, or if it’s the main entry point of the app. An intent filter must include a category of android.intent.category.DEFAULT if it’s to receive implicit intents. If an activity has no intent filter, or it doesn’t include a category name of android.intent.category. DEFAULT, it means that the activity can’t be started with an implicit intent. It can only be started with an explicit intent using the fully qualified component name.
So when we create implicit intent the information associated with intent is compared with the other apps AndroidManifest activities intent-filter and only those activities are filtered out the can handle the intent.

Nice post keep it up 😀👍
ReplyDeleteNice post 👍🏻
ReplyDeleteyou will definitely take place in indias top most blogger list