{"id":81423,"date":"2021-07-10T09:00:17","date_gmt":"2021-07-10T03:30:17","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=81423"},"modified":"2024-08-03T13:10:07","modified_gmt":"2024-08-03T07:40:07","slug":"android-intent-and-filter","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/","title":{"rendered":"Android Intent and Filter"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">This article will help you understand what android filter is and why it is used in Android. We have seen several android components, and now we will see how one component communicates with the other. Along with this, you will also find an implementation of the concept. Let&#8217;s begin.<\/span><\/p>\n<h3>What are Intents in Android?<\/h3>\n<p>Intents help the application components to communicate with each other. For example, using intents, we can request other applications to perform some tasks.<\/p>\n<p>One typical example is when you click on any URL from an application; then, you see the browser opening that links for you.<\/p>\n<p>Intents perform several tasks that can be described as follows:<\/p>\n<h4>1. Starting an Activity<\/h4>\n<p>An activity is a screen through which a user interacts with his application. Using the intents, you can start a new activity. To start a new activity, we need to call the startActivity() with the intent object.<\/p>\n<p>For this, you need to pass the current activity context as one parameter and the name of the activity.<br \/>\nBelow is an example of the same.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">var intent = Intent(this, NewActivity:: class.java)\r\nstartActivity(intent)\r\n<\/pre>\n<h4>2. Starting a Service<\/h4>\n<p>A service is a process that doesn\u2019t have any user interface but executes in the background. Using the intent, we can even start a service.<\/p>\n<p>To start a service, you can pass the intent object to the startService() method.<\/p>\n<h4>3. Sending Broadcast<\/h4>\n<p>Broadcast notifies the user of any task\u2014for example, Battery low warning. Using intent, we can send broadcasts to our device. For this, we need to pass the intent object to sendBroadcast() method.<\/p>\n<h4>Intent Object<\/h4>\n<p>An intent object is like a copy or an instance of the Intent class. It encapsulates many pieces of information related to the intent. These pieces of information are helpful to know which component to start and what task to perform.<\/p>\n<p>Any intent object contains six things:<\/p>\n<h4>Component Name &#8211;<\/h4>\n<p>The component name contains the name of the component to which the system needs to make intent. To set the component name, you can use any of the following functions:<\/p>\n<ul>\n<li>setComponent()<\/li>\n<li>setClass()<\/li>\n<li>setClassName()<\/li>\n<\/ul>\n<h4>Action &#8211;<\/h4>\n<p>The action specifies the specific task which we wish to perform on the android component. There are several actions that an intent object can perform. Some of them are as follows:<\/p>\n<table style=\"height: 630px;\" width=\"734\">\n<tbody>\n<tr>\n<td><b>Action Name<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ACTION_VIEW<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It displays data on the application screen.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ACTION_EDIT<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It allows you to edit the data.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ACTION_DIAL<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It displays the phone number in your phone dialer.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ACTION_TIMEZONE_CHANGED<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It notifies us when there is a change in your time zone.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ACTION_HEADSET_PLUG<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It notifies us when there is a headset plugged into our device.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ACTION_BATTERY_LOW<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It notifies whenever our device battery falls below a specific value.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ACTION_CALL<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It allows you to make a call from your dialer application.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">ACTION_SYNC<\/span><\/td>\n<td><span style=\"font-weight: 400;\">It allows you to sync your application\u2019s data or the user\u2019s data on the server.<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Data &#8211;<\/h4>\n<p>Data provides the type and the actual data. The data is in the form of a URI(Uniform Resource Identifier) and has a specific MIME type to distinguish.<\/p>\n<h4>Flags-<\/h4>\n<p>Flags are an optional parameter but yet essential one. It helps us to describe the behavior of the intent. For example, suppose while launching a new activity if we want to clear the most recent activity from the activity stack. Then we can use the FLAG_ACTIVITY_CLEAR_TOP flag.<\/p>\n<p>Similarly, there are many other flags for specific purposes. Some of them are as follows:<\/p>\n<table>\n<tbody>\n<tr>\n<td><b>Flag Name<\/b><\/td>\n<td><b>Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FLAG_ACTIVITY_CLEAR_TOP<\/span><\/td>\n<td><span style=\"font-weight: 400;\">Using this, the top of the activity is cleared and replaced with the new activity.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400;\">FLAG_ACTIVITY_CLEAR_TASK<\/span><\/td>\n<td><span style=\"font-weight: 400;\">This clears all the existing activities and makes the new activity the root activity.<\/span><\/td>\n<\/tr>\n<tr>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>Extras &#8211;<\/h4>\n<p>This is also an optional parameter and is used to send some extra data along with your intent. The data is provided in the form of a key-value pair, allowing you to pass complex data structures like arrays and bundles. This is useful when you need to pass data between activities or services, such as user inputs or settings.<\/p>\n<h4>Category &#8211;<\/h4>\n<p>This is also an optional parameter and used to provide some additional information about the intent. The intent object can contain many categories, each defining the kind of component the intent should target. By categorizing intents, Android can better understand the type of action required and respond appropriately.<\/p>\n<p>Some of them are as follows:<\/p>\n<h4>BROWSABLE:<\/h4>\n<p>This means that the components can run on browsers, allowing web content to be opened directly from an app. It enables intents to be handled by activities that support browsing capabilities.<\/p>\n<h4>ALTERNATIVE:<\/h4>\n<p>This means the components should be present in the alternative list. This category can be used to provide alternative actions to the user for a given intent, offering more flexibility in app interactions.<\/p>\n<h4>GADGET:<\/h4>\n<p>This means the components can be made available on some devices. It suggests that the intent is suitable for specific devices or form factors, such as wearables or home gadgets.<\/p>\n<h4>HOME:<\/h4>\n<p>It redirects the user to his home screen. This category is often used in intents that reset the user interface or bring the user back to a starting point in the app.<\/p>\n<p>We can specify the category by using the addCategory() method. To delete a category from an intent object, you can use the deleteCategory() method.<\/p>\n<h3>Types of Intent in Android<\/h3>\n<p>Intents are of two types, as shown in the below figure:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Types-of-Intent-in-Android.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82739\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Types-of-Intent-in-Android.jpg\" alt=\"Types of Intent in Android\" width=\"570\" height=\"208\" \/><\/a><\/p>\n<h4>Android Implicit Intent<\/h4>\n<p>Here you don\u2019t need to specify any component name. In Implicit intent, you only need to determine the type of action you need to perform. It is helpful to perform the functionalities which your application is not alone able to achieve.<\/p>\n<p>You can implement it in the following way:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Code:\r\nintent = Intent(Intent.ACTION_VIEW)  \r\nintent.setData(Uri.parse(\"https:\/\/techvidvan.com\/tutorials\/\"))  \r\nstartActivity(intent)  \r\n<\/pre>\n<p>The below picture shows an example of implicit intent. So, when you want to access the camera from your application, our application makes an intent to open the camera application.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Implicit-Intent.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82740\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Implicit-Intent.jpg\" alt=\"Implicit Intent Example\" width=\"563\" height=\"350\" \/><\/a><\/p>\n<h4>Explicit Intent in Android<\/h4>\n<p>Unlike Implicit Intent, here, you are required to provide the component name. However, any request is satisfied with the application component itself.You can implement it in the following way:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Code:\r\nvar intent = Intent(this, NewActivity:: class.java)\r\nstartActivity(intent)\r\n<\/pre>\n<p>Below you can see a picture demonstrating how explicit intent works.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Explicit-Intent.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82738\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Explicit-Intent.jpg\" alt=\"Explicit Intent in Android\" width=\"473\" height=\"298\" \/><\/a><\/p>\n<h3>Intent Filters in Android<\/h3>\n<p>Intent Filters are the declarations that are present in your app\u2019s manifest file. This plays an essential role in defining the behavior of the intent. In addition, these filters help you in customizing your intents.<\/p>\n<p>To define the behavior of intent, you require the following attribute tags in the intent filter:<\/p>\n<ul>\n<li><strong>&lt;actions&gt;<\/strong> &#8211; In this, you can keep all the actions you wish your intent to accept.<\/li>\n<li><strong>&lt;data&gt;<\/strong> &#8211; It defines the type of data that the intent will take.<\/li>\n<li><strong>&lt;category&gt;<\/strong> &#8211; It represents the name of the category that the intent will accept.<\/li>\n<\/ul>\n<p>Below is an example code fore the same:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;activity android:name ``.TechVidvanActivity\u201d&gt;\r\n&lt;intent-filter&gt;\r\n&lt;action android:name= \u201candroid.intent.action.VIEW\u201d&gt;\r\n&lt;category android:name= \u201candroid.intent.category.BROWSABLE\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<\/pre>\n<p><span style=\"font-weight: 400;\">Similar to the above, you can even have multiple activities with multiple intent filters in your manifest file.<\/span><\/p>\n<h4>Intent Resolution<\/h4>\n<p>Intent resolution is the process of searching for appropriate application components for your intents. Usually, we see intent resolution in the case of implicit intent.<\/p>\n<p>In Implicit intent, since we don\u2019t provide the component name, the system tries to find a component. This finding of the android component is in three steps:<\/p>\n<h5>1. Action Test:<\/h5>\n<p>In this step, the system tries to figure out if intent action and the intents in the intent filter are identical or not. If they are the same, then this test is passed.<\/p>\n<h5>2. Category Test:<\/h5>\n<p>In this step, this system checks if the category name is identical to what is mentioned in the intent filter. If it\u2019s exact, then this test is passed.<\/p>\n<h5>3. Data Test:<\/h5>\n<p>In this step, the system checks the MIME type of your data with the data in the intent filter. If it is the same, then this check is passed.<\/p>\n<h4>Pending Intent in Android<\/h4>\n<p>Pending intents are very useful in android development. The pending intent acts as a secure shell allowing the external applications to communicate securely. It allows the external applications to communicate only when the user grants permission to do so. Until then, our application can\u2019t access the external application.<\/p>\n<p>For example: Suppose you want to perform a task at a particular time. Then you can use the pending intent to fire that intent at that specific time.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Pending-Intent-in-Android.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82741\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Pending-Intent-in-Android.jpg\" alt=\"Pending Intent in Android\" width=\"540\" height=\"238\" \/><\/a><\/p>\n<h3>Implementation of Intent in Android<\/h3>\n<p>Below are the steps using which you can implement intent in Android. You will see how you can make an application where if you paste any URL, it opens the URL for you in a browser.<\/p>\n<h4>Step 1:<\/h4>\n<p>Open your Android Studio.<\/p>\n<h4>Step 2:<\/h4>\n<p>Click on Create New Project.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Intent_App_building_1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82745\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Intent_App_building_1.png\" alt=\"Create project in Android\" width=\"1156\" height=\"788\" \/><\/a><\/p>\n<h4>Step 3:<\/h4>\n<p>Select Empty Activity and proceed.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Intent_App_building_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82746\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Intent_App_building_2.png\" alt=\"Android Intent App building\" width=\"1396\" height=\"968\" \/><\/a><\/p>\n<h4>Step 4:<\/h4>\n<p>Enter your application name. In my case, it\u2019s \u201cTechVidvanIntents.\u201d Next, select Kotlin from the dropdown. For the API level, select API 22 for now.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Intent_App_building_3.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82747\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/Intent_App_building_3.png\" alt=\"Android intent\" width=\"1436\" height=\"964\" \/><\/a><\/p>\n<h4>Step 5:<\/h4>\n<p>Now go to res &#8212;&gt; layout &#8212;-&gt; and open activity_main.xml. Now here, you need to create one edit text and button. You can paste the below code in your activity_main.xml file.<\/p>\n<p><strong>activity_main.xml<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;LinearLayout 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    android:orientation=\"vertical\"\r\n    tools:context=\".MainActivity\"&gt;\r\n\r\n    &lt;TextView\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:text=\"Tech Vidvan\"\r\n        android:textColor=\"#FF5722\"\r\n        android:textStyle=\"bold\"\r\n        android:textSize=\"40sp\"\r\n        android:gravity=\"center\"\r\n        android:layout_marginTop=\"20dp\"\r\n        \/&gt;\r\n    &lt;EditText\r\n        android:id=\"@+id\/text_url\"\r\n        android:layout_width=\"match_parent\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:layout_margin=\"30dp\"\r\n        android:padding=\"20dp\"\r\n        android:hint=\"Enter the URL\"\/&gt;\r\n    \r\n    &lt;Button\r\n        android:onClick=\"openBrowserWithURL\"\r\n        android:layout_width=\"wrap_content\"\r\n        android:layout_height=\"wrap_content\"\r\n        android:text=\"Open\"\r\n        android:layout_gravity=\"center\"\r\n        android:layout_marginTop=\"20dp\"\/&gt;\r\n\r\n&lt;\/LinearLayout&gt;\r\n<\/pre>\n<h4>Step 6:<\/h4>\n<p>After editing your XML file, you must create an intent object in your Main Activity file. Paste the below code in your Main Activity file.<\/p>\n<p><strong>MainActivity.kt <\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">package com.example.techvidvanintents\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.EditText\r\n\r\nclass MainActivity : AppCompatActivity()\r\n{\r\n    \/\/variable to fetch the user\r\n    \/\/input URL\r\n    lateinit var text_url:EditText\r\n\r\n    override fun onCreate(savedInstanceState: Bundle?)\r\n    {\r\n        super.onCreate(savedInstanceState)\r\n        setContentView(R.layout.activity_main)\r\n\r\n        \/\/Binding the edit text with the variable\r\n        text_url = findViewById(R.id.text_url)\r\n    }\r\n\r\n    fun openBrowserWithURL(view: View)\r\n    {\r\n        \/\/Will be called immediately when the user presses\r\n        \/\/the button\r\n\r\n        \/\/first fetch the user URL\r\n        var url = text_url.text.toString()\r\n\r\n        \/\/Now call the intent to open this URL\r\n        var intent = Intent(Intent.ACTION_VIEW)\r\n        intent.setData(Uri.parse(url))\r\n        startActivity(intent)\r\n\r\n    }\r\n}\r\n<\/pre>\n<p>Now, your application is read. Now just click on the run button, and the app will install on your device.<br \/>\nThe application would look as below:<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82749\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_1.jpg\" alt=\"Android App\" width=\"1080\" height=\"2280\" \/><\/a><\/p>\n<p>Now in the edit text, you need to enter the URL which you wish to browse.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82750\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_2.jpg\" alt=\"Android App\" width=\"1080\" height=\"2280\" \/><\/a><\/p>\n<p>After you enter the URL, press the open button, and the browser will open that link for you.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-82751\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2021\/07\/App_Output_3.jpg\" alt=\"Android App Output\" width=\"1080\" height=\"2280\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>Through this article, you saw what an Intent is and why it is useful in android. Next, you saw the various types of intents, and then you understood the intent object. Later, you came across the intent filters and saw how you could declare them in your Manifest file.<\/p>\n<p>Finally, you saw the implementation of the above concepts through an app. I hope you enjoyed the article and have got some insights.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article will help you understand what android filter is and why it is used in Android. We have seen several android components, and now we will see how one component communicates with the&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":82291,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2791],"tags":[3716,3717,3718,3719],"class_list":["post-81423","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android-filter","tag-android-intent","tag-android-intent-implementation","tag-android-intent-resolution"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Intent and Filter - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn what an Intent is, its types and why it is used in android. Learn about Intent Resolution, intent filter and implementation.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Intent and Filter - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn what an Intent is, its types and why it is used in android. Learn about Intent Resolution, intent filter and implementation.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-10T03:30:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-08-03T07:40:07+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Android_Intent_Android_Filter.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan 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 Filter - TechVidvan","description":"Learn what an Intent is, its types and why it is used in android. Learn about Intent Resolution, intent filter and implementation.","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:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/","og_locale":"en_US","og_type":"article","og_title":"Android Intent and Filter - TechVidvan","og_description":"Learn what an Intent is, its types and why it is used in android. Learn about Intent Resolution, intent filter and implementation.","og_url":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2021-07-10T03:30:17+00:00","article_modified_time":"2024-08-03T07:40:07+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Android_Intent_Android_Filter.jpg","type":"image\/jpeg"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"10 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Android Intent and Filter","datePublished":"2021-07-10T03:30:17+00:00","dateModified":"2024-08-03T07:40:07+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/"},"wordCount":1685,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Android_Intent_Android_Filter.jpg","keywords":["Android filter","Android Intent","Android Intent Implementation","Android Intent Resolution"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/","url":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/","name":"Android Intent and Filter - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Android_Intent_Android_Filter.jpg","datePublished":"2021-07-10T03:30:17+00:00","dateModified":"2024-08-03T07:40:07+00:00","description":"Learn what an Intent is, its types and why it is used in android. Learn about Intent Resolution, intent filter and implementation.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Android_Intent_Android_Filter.jpg","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2021\/06\/Android_Intent_Android_Filter.jpg","width":1200,"height":628,"caption":"Android Intent"},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/android-intent-and-filter\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Android Intent and Filter"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81423","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=81423"}],"version-history":[{"count":2,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81423\/revisions"}],"predecessor-version":[{"id":447569,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/81423\/revisions\/447569"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/82291"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=81423"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=81423"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=81423"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}