

{"id":75713,"date":"2020-02-11T13:55:23","date_gmt":"2020-02-11T08:25:23","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=75713"},"modified":"2021-08-25T13:55:45","modified_gmt":"2021-08-25T08:25:45","slug":"android-intent","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/android-intent\/","title":{"rendered":"Android Intent and Intent Filters &#8211; Learn to Implement in Android Studio"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1048,&quot;href&quot;:&quot;https:\\\/\\\/developer.android.com\\\/guide\\\/topics\\\/manifest\\\/manifest-intro&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20250911141749\\\/https:\\\/\\\/developer.android.com\\\/guide\\\/topics\\\/manifest\\\/manifest-intro&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-08 23:01:57&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-13 06:06:26&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-17 10:41:21&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-21 00:51:08&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-02 00:39:41&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-05 06:40:49&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-08 06:52:43&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-16 21:08:44&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-21 05:05:49&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-25 05:57:19&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-30 04:55:09&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-04 05:55:36&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-09 14:08:08&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-28 03:38:27&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-03 15:18:10&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-11 06:52:57&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-16 09:42:03&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-21 08:38:33&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-24 11:13:30&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-28 02:19:05&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-31 19:15:21&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-06 04:59:53&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-10 15:42:36&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-16 06:36:40&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-19 11:05:22&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-04 17:45:07&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-12 08:36:36&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-15 14:09:16&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-20 06:04:30&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-26 08:34:53&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-04 10:58:52&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-12 08:09:34&quot;,&quot;http_code&quot;:503}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-12 08:09:34&quot;,&quot;http_code&quot;:503},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>As we know, the core components of Android are Services, <em><strong><a href=\"https:\/\/data-flair.training\/blogs\/android-activity\/\">Activities<\/a><\/strong><\/em>, and Broadcast Receivers. Now, for their activation, we use messages known as <strong>Intents<\/strong>. Intent in Android enables communication between components of the same as well as different applications.<\/p>\n<p>In other words, we can understand them as <em>asynchronous messages<\/em>. These messages allow application components to request required functionalities from other components of the application.<\/p>\n<h2>Android Intent<\/h2>\n<p>Intents are the objects of <strong>android.content.intent<\/strong> type. Intent performs the following three tasks mainly:<\/p>\n<h3>1. Starting an Activity<\/h3>\n<p>An <strong>Activity<\/strong> starts\/performs a task when we pass the <strong>Intent<\/strong> object to the content.<strong>startActivity()<\/strong> method. When an intent object is passed to <strong>startActivity()<\/strong>, it starts a new activity or an existing one.<\/p>\n<h3>2. Starting a Service<\/h3>\n<p>An <strong>Intent<\/strong> object is passed to the <strong>content.startService()<\/strong> method, to start a Service. We can also send a required request to an existing service.<\/p>\n<h3>3. Delivering a Broadcast<\/h3>\n<p>Passing the <strong>Intent<\/strong> object in <strong>content.sendBroadcast()<\/strong>, sends messages to broadcast receivers.<\/p>\n<h3>Intent Object<\/h3>\n<p>Intent objects are nothing, but a lot of information wrapped together. An Intent object basically contains the information to determine the component to start and the actions for them.<\/p>\n<p>Come let\u2019s see what all information an Intent Object contains within.<\/p>\n<p>Any Intent object contains the following six things :<\/p>\n<ol>\n<li>Component Name<\/li>\n<li>Action<\/li>\n<li>Data<\/li>\n<li>Category<\/li>\n<li>Extras<\/li>\n<li>Flag<\/li>\n<\/ol>\n<p>Now we\u2019ll see these things in detail one by one.<\/p>\n<h4>1. Component Name<\/h4>\n<p>The intent object holds the name of the component of the Android application. Using component names, the system delivers an intent to a particular application component. At times, we forget to mention the component name, in such cases, the Android system decides it based on the other characters. To set the component name, we use one of the following three methods :<\/p>\n<ul>\n<li>setComponent()<\/li>\n<li>setClass()<\/li>\n<li>setClassName()<\/li>\n<\/ul>\n<p>If we want to read the component name, we can read it using the <strong>getComponent()<\/strong> method.<\/p>\n<h4>2. Action<\/h4>\n<p>Action defines the general task that is to be performed on components. Now, these actions directly target Activities, Services or <em><strong><a href=\"https:\/\/data-flair.training\/blogs\/android-broadcast-receiver\/\">Broadcast Receivers<\/a><\/strong><\/em>. Let\u2019s see a few actions that an intent object stores:<\/p>\n<ul>\n<li><strong>ACTION_CALL:<\/strong> This is for initiating calls from the user\u2019s device.<\/li>\n<li><strong>ACTION_EDIT:<\/strong> This is to edit and make changes in the data that is visible to the users.<\/li>\n<li><strong>ACTION_MAIN:<\/strong> This is an initial activity of a task. It takes no input and returns no output.<\/li>\n<li><strong>ACTION_DIAL:<\/strong> This is used to display a Dialer to the users.<\/li>\n<li><strong>ACTION_SYNC:<\/strong> This is to synchronize the user\u2019s data on their device on a server.<\/li>\n<li><strong>ACTION_HEADSET_PLUG:<\/strong> This displays that a headset is plugged in or taken out.<\/li>\n<li><strong>ACTION_SCREENON:<\/strong> This is for turning on the screen of the user\u2019s device.<\/li>\n<li><strong>ACTION_BATTERY_LOW:<\/strong> This is a warning for a low running battery.<\/li>\n<li><strong>ACTION_VIEW:<\/strong> This displays the data to the users on the screens of their devices.<\/li>\n<\/ul>\n<p>Actions of an Intent Object are set using <strong>setAction()<\/strong> method and read through <strong>getAction()<\/strong> method.<\/p>\n<h4>3. Data<\/h4>\n<p>Data stores and tells the type of the data to the IntentFilters. While creating an Intent, it\u2019s important to specify the type of data in it. While defining the data type that is the MIME type of Data in addition to its URI, the data is expressed as <strong>URI (Uniform Resource Identifier)<\/strong>.<\/p>\n<p>Different actions are paired with different types of data specifications.<\/p>\n<p><strong>For example &#8211;<\/strong> Action_Edit would contain the URI of Document and Action_dial would contain tell: URI.<\/p>\n<h4>4. Category<\/h4>\n<p>This contains some additional information about what kind of object should hold the intent. An intent object can contain any number of type of categories. This field is optional in an IntentObject.<\/p>\n<p>Some of the categories included are as follows :<\/p>\n<ul>\n<li><strong>BROWSABLE:<\/strong> The target components can be invoked in browsers to display data or message.<\/li>\n<li><strong>ALTERNATIVE:<\/strong> This means the component should be added in the list of alternative actions that the user performs on some data.<\/li>\n<li><strong>GADGET:<\/strong> This activity can be added inside some other components that host the gadgets.<\/li>\n<li><strong>HOME:<\/strong> This displays the home page of the user\u2019s device.<\/li>\n<li><strong>LAUNCHER:<\/strong> The target can be an initial task and listed on the top of the application launcher.<\/li>\n<\/ul>\n<p>To specifically set the Intent Object, the category we use is the <strong>addCategory()<\/strong> method. If we like, we can also delete some categories using <strong>deleteCatergory()<\/strong>. To get all the lists of categories on a component, we use <strong>getCategory()<\/strong>.<\/p>\n<h4>5. Extras<\/h4>\n<p>This is a piece of extended information, in addition to the provided one. This is optional and is used only in case when there is a need to provide some extra information for the component. It is just an extra key-value pair for the component.<\/p>\n<h4>6. Flags<\/h4>\n<p>Flags are also provided in Intent Objects for different types of tasks. There are various types of flags that can be set using the addFlags() method and the setFlags() method.<\/p>\n<h3>Types of Intent in Android<\/h3>\n<p>Intents can be of two types as mentioned in the diagram. Now we\u2019ll see both these types one by one.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-android-intents.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75725\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-android-intents.jpg\" alt=\"android intent types\" width=\"420\" height=\"216\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-android-intents.jpg 420w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-android-intents-150x77.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/types-of-android-intents-300x154.jpg 300w\" sizes=\"auto, (max-width: 420px) 100vw, 420px\" \/><\/a><\/p>\n<h4>Implicit Intent in Android<\/h4>\n<p>Implicit Type of Intents are those that do not mention any component name and only declare the actions.<\/p>\n<p>Implicit Intents specifies these actions that are to be performed. These actions can invoke any application component that can perform these actions. These are useful when your action is important but your application is not capable of performing it.<\/p>\n<p>Let\u2019s check the following so we can learn how to use it:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Intent intent = new Intent();\r\nintent.setAction=(Intent.ACTION_DIAL);<\/pre>\n<h4>Explicit Intent in Android<\/h4>\n<p>Explicit Type are those Intents that specifically mention the component that it targets. The Android system calls these components by explicitly mentioning them. We can use Explicit Intent for the purpose of launching an application component.<\/p>\n<p>Following is an example to implement Explicit Intent:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">Intent intent = new Intent(this,MyActivity.class);\r\nintent.putExtra(\u201cValue 1\u201d, \u201cValue one for MyActivity\u201d);<\/pre>\n<p>Now that we\u2019ve seen Intents, Intent Objects, their components, and Intent Types, we\u2019ll move towards the next interesting topic that is Intent Filters.<\/p>\n<h4>Intent Filters in Android<\/h4>\n<p>Intent Filters are expressions in the <a href=\"https:\/\/developer.android.com\/guide\/topics\/manifest\/manifest-intro\">Manifest<\/a> file of an Android Application. These are responsible for deciding the behavior of the Intent. Intent filters that we mention in the Manifest file can be nested with the application components.<\/p>\n<p>Basically, Intent Filters can define the behavior of Intents using three Elements, that are-<\/p>\n<ul>\n<li><strong>&lt;actions&gt; &#8211;<\/strong> Action name defines the intent action that it\u2019ll accept.<\/li>\n<li><strong>&lt;data&gt; &#8211;<\/strong> Data defines the data that is acceptable.<\/li>\n<li><strong>&lt;category&gt; &#8211;<\/strong> Category defines the name of the Intent Category that is acceptable.<\/li>\n<\/ul>\n<p>We\u2019ll see the following example to understand its implementation:<\/p>\n<p><strong>Intent Filter in Manifest.xml:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;activity android:name ``.MainActivity\u201d&gt;\r\n&lt;intent-filter&gt;\r\n&lt;action android:name= \u201candroid.intent.action.SEND\u201d&gt;\r\n&lt;category android:name= \u201candroid.intent.category.HOME\u201d&gt;\r\n&lt;data android:mimeType= \u201ctext\/plain\u201d&gt;\r\n&lt;\/intent-filter&gt;\r\n&lt;\/activity&gt;<\/pre>\n<p><strong>Multiple Intent in Manifest.xml:<\/strong><\/p>\n<p>Multiple Intent Filters can also be present in a single <strong>Manifest file<\/strong>, as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;activity android:name ``.MainActivity\u201d&gt;\r\n&lt;intent-filter&gt;\r\n&lt;action android:name= \u201candroid.intent.action.SEND\u201d&gt;\r\n&lt;category android:name= \u201candroid.intent.category.HOME\u201d&gt;\r\n&lt;data android:mimeType= \u201ctext\/plain\u201d&gt;\r\n&lt;\/intent-filter&gt;\r\n&lt;\/activity&gt;\r\n&lt;activity android:name ``.MyActivity\u201d&gt;\r\n&lt;intent-filter&gt;\r\n&lt;action android:name= \u201candroid.intent.action.EDIT\u201d&gt;\r\n&lt;category android:name= \u201candroid.intent.category.ALTERNATIVE\u201d&gt;\r\n&lt;data android:mimeType= \u201ctext\/plain\u201d&gt;\r\n&lt;\/intent-filter&gt;\r\n&lt;\/activity&gt;<\/pre>\n<h3>Intent Resolution<\/h3>\n<p>The intent resolution comes in the role when the system receives an implicit intent. What exactly happens is, Implicit intents do not mention the name of the components. Therefore the system needs to search for the appropriate application component that can perform the actions. This searching process takes place in the following three tests:<\/p>\n<h4>1. Action Test<\/h4>\n<p>In this, the system checks the Intent action matches with the intents in the intent filter. If it does, it passes this test, otherwise, it fails.<\/p>\n<h4>2. Category Test<\/h4>\n<p>In this, the system checks the Intent category matches with the categories in the intent filter. If it does, it passes this test, otherwise, it fails.<\/p>\n<h4>3. Data Test<\/h4>\n<p>In this, the system checks the Intent MIME data matches with the data in the intent filter. If it does, it passes this test, otherwise, it fails.<\/p>\n<p>To understand this see the following:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;intent-filter&gt;\r\n\r\n&lt;action android:name= \u201candroid.intent.action.EDIT\u201d&gt; \/\/ It is matched with the list of actions of Intents.\r\n\r\n&lt;category android:name= \u201candroid.intent.category.ALTERNATIVE\u201d&gt;\/\/ It is matched with the list of categories of Intents.\r\n\r\n&lt;data android:mimeType= \u201ctext\/plain\u201d&gt;\/\/ It is matched with the list of MIME data of Intents.\r\n&lt;\/intent-filter&gt;<\/pre>\n<p>Now if these tests are passed, Intents are said to match.This is known as<strong> Intent Matching<\/strong>. Intent matching is only said to be successful, if all the actions and categories of Intents match against the filters of the<strong><code>IntentFilter<\/code><\/strong> class.<\/p>\n<h3>Pending Intent in Android<\/h3>\n<p>While studying about Android intents, we should not forget the topic, Pending Intents. Pending Intents are like a protective shield over the Intent objects. It covers them and grants permission to the external applications to access them.<\/p>\n<p><strong>For example &#8211;<\/strong> If you have an Intent, which the system should access only at a particular time, you can use Pending Intent.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/pending-intent.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75726\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/pending-intent.jpg\" alt=\"pending intent in android\" width=\"200\" height=\"186\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/pending-intent.jpg 200w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/pending-intent-150x140.jpg 150w\" sizes=\"auto, (max-width: 200px) 100vw, 200px\" \/><\/a><\/p>\n<h3>Implementation of Intent in Android<\/h3>\n<p>Now that we\u2019re done with the theory part of Intents, let us implement it in Android Studio. In this application, we\u2019ll take the user from the Activity to the respective URL.<\/p>\n<p><strong>Step 1:<\/strong> First of all, create a new project and fill in the required details.<\/p>\n<p><strong>Step 2:<\/strong> Now, open the <strong>main_activity.xml<\/strong> file, and write the following given code there.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;RelativeLayout\r\n   xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n   xmlns:tools=\"http:\/\/schemas.android.com\/tools\"\r\n   android:layout_width=\"match_parent\"\r\n   android:layout_height=\"match_parent\"\r\n   tools:context=\"com.DataFlair.dataflair_intent.MainActivity\"&gt;\r\n   &lt;TextView\r\n       android:id=\"@+id\/textView2\"\r\n       android:layout_width=\"wrap_content\"\r\n       android:layout_height=\"wrap_content\"\r\n       android:layout_centerHorizontal=\"true\"\r\n       android:layout_marginLeft=\"100dp\"\r\n       android:text=\"DataFlair \"\r\n       android:textColor=\"@color\/colorPrimaryDark\"\r\n       android:textSize=\"50dp\" \/&gt;\r\n   &lt;EditText\r\n       android:layout_width=\"wrap_content\"\r\n       android:layout_height=\"wrap_content\"\r\n       android:id=\"@+id\/urlText\"\r\n       android:layout_alignParentTop=\"true\"\r\n       android:layout_centerHorizontal=\"true\"\r\n       android:layout_marginTop=\"100dp\"\r\n       android:layout_marginLeft=\"50dp\"\r\n       android:ems=\"10\" \/&gt;\r\n   &lt;Button\r\n       android:layout_width=\"wrap_content\"\r\n       android:layout_height=\"wrap_content\"\r\n       android:id=\"@+id\/browse\"\r\n       android:layout_below=\"@+id\/urlText\"\r\n       android:text=\"Let's Go\"\r\n       android:layout_marginLeft=\"50dp\"\r\n       android:layout_centerHorizontal=\"true\" \/&gt;\r\n&lt;\/RelativeLayout&gt;<\/pre>\n<p><strong>Step 3:<\/strong> After the above step, write the following code in <strong>MainActivity.java<\/strong> file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.DataFlair.dataflair_intent;\r\n\r\nimport android.content.Intent;\r\nimport android.net.Uri;\r\nimport androidx.appcompat.app.AppCompatActivity;\r\nimport android.os.Bundle;\r\nimport android.view.View;\r\nimport android.widget.Button;\r\nimport android.widget.EditText;\r\n\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n\r\n   @Override\r\n   protected void onCreate(Bundle savedInstanceState) {\r\n       super.onCreate(savedInstanceState);\r\n       setContentView(R.layout.activity_main);\r\n       final EditText editText = (EditText)findViewById(R.id.urlText);\r\n       Button btn = (Button) findViewById(R.id.browse);\r\n       btn.setOnClickListener(new View.OnClickListener() {\r\n           @Override\r\n           public void onClick(View v) {\r\n               String url = editText.getText().toString();\r\n               Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(url));\r\n               startActivity(intent);\r\n           }\r\n       });\r\n   }\r\n}<\/pre>\n<p><strong>Step 4:<\/strong> After we\u2019re done with this. The next step is to press the <strong>run<\/strong> button. After that the output would be:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75727\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output.png\" alt=\"Android Intent output\" width=\"300\" height=\"533\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-84x150.png 84w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-169x300.png 169w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>In this, you need to enter the URl that you want to open through the application.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75728\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-1.png\" alt=\"android intent output\" width=\"300\" height=\"533\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-1.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-1-84x150.png 84w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-1-169x300.png 169w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75729\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-2.png\" alt=\"Android Intent output\" width=\"300\" height=\"533\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-2.png 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-2-84x150.png 84w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Intent-output-2-169x300.png 169w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>Now that we\u2019ve now seen Android Intents, we\u2019ve got an idea of what it is. Right? In this article, we\u2019ve studied what is intent and its types. We learned about Intent Filter and Pending Intents. We\u2019ve also studied the main components of Intents and Intent Filter. Coming towards the end, we also implemented Intents. Now I&#8217;m hoping that you\u2019ll try it and I\u2019ll see you in the next article.<\/p>\n<p>Do share your views regarding the Android Intent Tutorial in the comment section.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As we know, the core components of Android are Services, Activities, and Broadcast Receivers. Now, for their activation, we use messages known as Intents. Intent in Android enables communication between components of the same&#46;&#46;&#46;<\/p>\n","protected":false},"author":10,"featured_media":75730,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18722],"tags":[21847,21851,21853,21852,21849,21850,21848],"class_list":["post-75713","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android-intent","tag-android-intent-example","tag-explicit-intent-in-android","tag-implicit-intent-in-android","tag-intent-filter-in-android","tag-pending-intent-in-android","tag-types-of-intent-in-android"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Intent and Intent Filters - Learn to Implement in Android Studio - DataFlair<\/title>\n<meta name=\"description\" content=\"Android Intent - Learn about intent object, types of intents in Android, intent filters and intent resolution and implementation of intent in Android studio.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/data-flair.training\/blogs\/android-intent\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Intent and Intent Filters - Learn to Implement in Android Studio - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Android Intent - Learn about intent object, types of intents in Android, intent filters and intent resolution and implementation of intent in Android studio.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/android-intent\/\" \/>\n<meta property=\"og:site_name\" content=\"DataFlair\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DataFlairWS\/\" \/>\n<meta property=\"article:published_time\" content=\"2020-02-11T08:25:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-25T08:25:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-intent-tutorial.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"802\" \/>\n\t<meta property=\"og:image:height\" content=\"420\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DataFlair Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:site\" content=\"@DataFlairWS\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DataFlair Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"10 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Intent and Intent Filters - Learn to Implement in Android Studio - DataFlair","description":"Android Intent - Learn about intent object, types of intents in Android, intent filters and intent resolution and implementation of intent in Android studio.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/data-flair.training\/blogs\/android-intent\/","og_locale":"en_US","og_type":"article","og_title":"Android Intent and Intent Filters - Learn to Implement in Android Studio - DataFlair","og_description":"Android Intent - Learn about intent object, types of intents in Android, intent filters and intent resolution and implementation of intent in Android studio.","og_url":"https:\/\/data-flair.training\/blogs\/android-intent\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-02-11T08:25:23+00:00","article_modified_time":"2021-08-25T08:25:45+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-intent-tutorial.jpg","type":"image\/jpeg"}],"author":"DataFlair Team","twitter_card":"summary_large_image","twitter_creator":"@DataFlairWS","twitter_site":"@DataFlairWS","twitter_misc":{"Written by":"DataFlair Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/android-intent\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/android-intent\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33"},"headline":"Android Intent and Intent Filters &#8211; Learn to Implement in Android Studio","datePublished":"2020-02-11T08:25:23+00:00","dateModified":"2021-08-25T08:25:45+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-intent\/"},"wordCount":1582,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-intent\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-intent-tutorial.jpg","keywords":["android intent","android intent example","explicit intent in android","implicit intent in android","intent filter in android","pending intent in android","types of intent in android"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/android-intent\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/android-intent\/","url":"https:\/\/data-flair.training\/blogs\/android-intent\/","name":"Android Intent and Intent Filters - Learn to Implement in Android Studio - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-intent\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-intent\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-intent-tutorial.jpg","datePublished":"2020-02-11T08:25:23+00:00","dateModified":"2021-08-25T08:25:45+00:00","description":"Android Intent - Learn about intent object, types of intents in Android, intent filters and intent resolution and implementation of intent in Android studio.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/android-intent\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/android-intent\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/android-intent\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-intent-tutorial.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-intent-tutorial.jpg","width":802,"height":420,"caption":"android intent tutorial"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/android-intent\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Blog Home","item":"https:\/\/data-flair.training\/blogs\/"},{"@type":"ListItem","position":2,"name":"Android Tutorials","item":"https:\/\/data-flair.training\/blogs\/category\/android\/"},{"@type":"ListItem","position":3,"name":"Android Intent and Intent Filters &#8211; Learn to Implement in Android Studio"}]},{"@type":"WebSite","@id":"https:\/\/data-flair.training\/blogs\/#website","url":"https:\/\/data-flair.training\/blogs\/","name":"DataFlair","description":"Learn Today. Lead Tomorrow.","publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/data-flair.training\/blogs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/data-flair.training\/blogs\/#organization","name":"DataFlair","url":"https:\/\/data-flair.training\/blogs\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2016\/07\/Data-Flair.png","width":106,"height":48,"caption":"DataFlair"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DataFlairWS\/","https:\/\/x.com\/DataFlairWS","https:\/\/www.linkedin.com\/company\/dataflair-web-services-pvt-ltd\/","https:\/\/www.youtube.com\/user\/DataFlairWS"]},{"@type":"Person","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33","name":"DataFlair Team","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/dd6de0d647a0185cd6faf264e4ba860b0d85d08d7070766f9cd41bea5bb0b227?s=96&d=mm&r=g","caption":"DataFlair Team"},"description":"The DataFlair Team is passionate about delivering top-notch tutorials and resources on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. With expertise in the tech industry, we simplify complex topics to help learners excel. Stay updated with our latest insights.","url":"https:\/\/data-flair.training\/blogs\/author\/dfadteam1\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/75713","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/comments?post=75713"}],"version-history":[{"count":6,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/75713\/revisions"}],"predecessor-version":[{"id":75738,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/75713\/revisions\/75738"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/75730"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=75713"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=75713"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=75713"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}