

{"id":76153,"date":"2020-02-20T14:27:14","date_gmt":"2020-02-20T08:57:14","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=76153"},"modified":"2021-08-25T13:55:36","modified_gmt":"2021-08-25T08:25:36","slug":"android-event-handling","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/android-event-handling\/","title":{"rendered":"Android Event Handling &#8211; Manage the Action of Users Interaction"},"content":{"rendered":"<p>Event handling comes with Event and Handling. The event here is nothing but an <em>Action<\/em>. Handling here means <em>managing<\/em>. In the whole Android Event Handling, all we do is manage the actions. These actions are related to the user\u2019s interaction. These Events collect data about the user\u2019s interaction using interactive components.<\/p>\n<p>For example, when you click on some button, onClick() is invoked. All the events in Android are stored in a Queue using First In First Out (FIFO) scheduling.<\/p>\n<p>Today in this article, we will learn about Event Handling in Android. But first, let&#8217;s get familiar with the concept of <em><strong><a href=\"https:\/\/data-flair.training\/blogs\/android-application-components\/\">Android Application Components.<\/a><\/strong><\/em><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-76220 size-full\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling.jpg\" alt=\"event handling in android\" width=\"802\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling.jpg 802w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling-520x272.jpg 520w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><\/p>\n<h2>Android Event Handling<\/h2>\n<p>To include the Event Handler in your application, you should know the following three concepts:<\/p>\n<ul>\n<li>Event Listeners<\/li>\n<li>Event Handlers<\/li>\n<li>Event Listener Registration<\/li>\n<\/ul>\n<h3>1. Event Listeners<\/h3>\n<p>An event listener is an interface in the View class of Android. It has a single callback method. This method will be called when the View that is registered with the Listener is activated by the user\u2019s action.<\/p>\n<p><strong>Following are some of the important Event Listeners:<\/strong><\/p>\n<table class=\"df-table-center\">\n<tbody>\n<tr>\n<td><b>\u00a0 \u00a0 \u00a0 Event Listeners<\/b><\/td>\n<td><b>\u00a0 \u00a0 \u00a0 Event listener Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onClick()<\/span><\/td>\n<td><span style=\"font-weight: 400\">This event occurs when the user clicks on an item on the screen in touch more or focuses on an item using a trackball or navigation-keys.\u00a0<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onLongClick()<\/span><\/td>\n<td><span style=\"font-weight: 400\">This event occurs when a user clicks on an item or screen for more than 1 second.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onFocusChange()<\/span><\/td>\n<td><span style=\"font-weight: 400\">This event occurs when a user navigates away from an item that was on focus.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onKey()<\/span><\/td>\n<td><span style=\"font-weight: 400\">This event occurs when a user focuses and clicks on an item.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onTouch()<\/span><\/td>\n<td><span style=\"font-weight: 400\">This event occurs when a user touches a particular range of an item with gestures or simple touch or tap.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onCreateContextMenu()<\/span><\/td>\n<td><span style=\"font-weight: 400\">This event occurs when a Context Menu is built.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onMenuItemClick()<\/span><\/td>\n<td><span style=\"font-weight: 400\">It occurs when a user clicks or selects an item from a menu.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>2. Event Handlers<\/h3>\n<p>Event handles are the actual methods that have the action that is to be taken. After an event has happened and event listeners are registered, event listeners call Event Handler. These are useful to define some callback methods.<\/p>\n<p><strong>Following are some of the important Event Handlers:<\/strong><\/p>\n<table class=\"df-table-center\">\n<tbody>\n<tr>\n<td><b>Event Handler<\/b><\/td>\n<td><b>Event Handler Description<\/b><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onKeyUp()<\/span><\/td>\n<td><span style=\"font-weight: 400\">The system invokes this method when a new key event occurs.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onKeyDown()<\/span><\/td>\n<td><span style=\"font-weight: 400\">The system invokes this method when a key down event occurs.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onTrackballEvent()<\/span><\/td>\n<td><span style=\"font-weight: 400\">The system invokes this method when a trackball motion event occurs.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onTouchEvent()<\/span><\/td>\n<td><span style=\"font-weight: 400\">The system invokes this method when some touch event occurs.<\/span><\/td>\n<\/tr>\n<tr>\n<td><span style=\"font-weight: 400\">onFocusChange()<\/span><\/td>\n<td><span style=\"font-weight: 400\">The system invokes this method when an item gets into focus or loses focus.<\/span><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>3. Event Listener Registration<\/h3>\n<p>Event Registration is the process in which Event Listeners are registered with Event Handlers. This is important as Handler will work only after the Listener fires an Event.<\/p>\n<p>Android Event Listener registration can be done in the following three ways:<\/p>\n<ol>\n<li>The first method to register event listeners is by directly mentioning them in activity_main.xml.<\/li>\n<li>We can also register event listeners by using Activity class that implements a listener interface.<\/li>\n<li>The last method is by using an Anonymous class.<\/li>\n<\/ol>\n<p><strong>The following is an example to demonstrate Event Listener Registration:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">@Override\r\nprotected void onCreate(Bundle savedInstanceState) {\r\n   Button button = (Button)findViewById(R.id.btn1);\r\n\r\n   button.setOnTouchListener(buttonListener);\r\n\/\/ code\r\n}\r\n\/\/ Anonymous implementation of OnTouchListener\r\nprivate View.OnTouchListener buttonListener = new View.OnTouchListener() {\r\n   public void onTouchEvent(View v) {\r\n    \/\/ define the action\r\n    }\r\n};<\/pre>\n<h4>Touch mode<\/h4>\n<p>While a user interacts with the device they roll the screen over. Therefore it\u2019s necessary to focus on the items that are actionable. In the devices with touch functionality, and the user begins interacting with it then it is not important to give focus on touchable items. This mode of interaction is<strong> \u201cTouch Mode\u201d.<\/strong> Once a user touches the screen, the device enters in touch mode and then onwards the actionable icons and buttons are kept on focus like &#8211;<a href=\"https:\/\/www.ibm.com\/support\/knowledgecenter\/STPVGU_7.8.1\/com.ibm.storage.svc.console.781.doc\/svc_svcnavbuttn_223fth.html\"> navigation button<\/a> or home button.<\/p>\n<h4>Handling Focus<\/h4>\n<p>The framework handles the focus movement according to user input. Handling the focus includes adding and removing the focus according to the user input movements. Focus changes with the help of Views. You can check if the View is set to be in focusable mode or not using <strong>isFocusable()<\/strong>. And we can also change the focus mode by using <strong>setFocusable().<\/strong><\/p>\n<p>We can set the focus of view in touch mode as well, using<strong> setFocusInTouchMode()<\/strong>. To check if a view allows focus in touch mode use<strong> isFocusableInTouchMode().<\/strong><\/p>\n<h3>Implementing Android Event Handling<\/h3>\n<p>Now we will move towards the implementation of <strong>Event Handling.<\/strong> We will implement and see how it works. Here I will show you how to implement onClick().<\/p>\n<p>Without any delay let&#8217;s start it:<\/p>\n<p><strong>Step 1:<\/strong> Open New Project and fill in all the required details.<\/p>\n<p><strong>Step 2:\u00a0<\/strong> After doing this open your project and we will set the layout and the required Id of the elements so we can call them easily.<\/p>\n<p>Open the<strong> activity_main.xml<\/strong> file. The following code is to be written in this file.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;LinearLayout xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\r\n   android:layout_width=\"match_parent\"\r\n   android:layout_height=\"match_parent\"\r\n   android:orientation=\"vertical\" &gt;\r\n\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:fontFamily=\"@font\/arya_bold\"\r\n   android:text=\"DataFlair \"\r\n   android:textColor=\"@color\/colorPrimaryDark\"\r\n   android:textSize=\"50dp\" \/&gt;\r\n\r\n&lt;Button\r\n   android:id=\"@+id\/btnClick\"\r\n   android:layout_width=\"wrap_content\"\r\n   android:layout_height=\"wrap_content\"\r\n   android:layout_marginLeft=\"150dp\"\r\n   android:layout_marginTop=\"100dp\"\r\n   android:fontFamily=\"@font\/arya_bold\"\r\n   android:text=\"Click Event\" \/&gt;\r\n\r\n&lt;TextView\r\n   android:id=\"@+id\/txtResult\"\r\n   android:layout_width=\"wrap_content\"\r\n   android:layout_height=\"wrap_content\"\r\n   android:textColor=\"#009999\"\r\n   android:layout_marginLeft=\"150dp\"\r\n   android:textSize=\"20dp\"\r\n   android:textStyle=\"bold\"\r\n   android:layout_marginTop=\"12dp\"\/&gt;\r\n\r\n&lt;TextView\r\n   android:id=\"@+id\/textView\"\r\n   android:layout_width=\"match_parent\"\r\n   android:layout_height=\"match_parent\"\r\n   android:layout_below=\"@+id\/button2\"\r\n   android:layout_centerHorizontal=\"true\"\r\n   android:fontFamily=\"@font\/arya_bold\"\r\n   android:gravity=\"center\"\r\n   android:text=\"See me!\"\r\n   android:textColor=\"#009999\"\r\n   android:textSize=\"25dp\" \/&gt;\r\n&lt;\/LinearLayout&gt;<\/pre>\n<p><strong>Step 3:<\/strong>\u00a0 After writing the code of activity.xml. We will now write the code for <strong>main_activity.java<\/strong> as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">package com.DataFlair.dataflaireventhandling;\r\n\r\nimport android.os.Bundle;\r\nimport android.view.Gravity;\r\nimport android.view.View;\r\nimport android.widget.Button;\r\nimport androidx.appcompat.app.AppCompatActivity;\r\nimport android.widget.TextView;\r\n\r\npublic class MainActivity extends AppCompatActivity {\r\n   Button btn;\r\n   TextView tView;\r\n   @Override\r\n   protected void onCreate(Bundle savedInstanceState) {\r\n      super.onCreate(savedInstanceState);\r\n      setContentView(R.layout.activity_main);\r\n      btn = (Button)findViewById(R.id.btnClick);\r\n      tView = (TextView)findViewById(R.id.txtResult);\r\n      btn.setOnClickListener(new View.OnClickListener() {\r\n         @Override\r\n         public void onClick(View v) {\r\n            TextView txtView = (TextView) findViewById(R.id.textView);\r\n            txtView.setText(\"You've Clicked \\n The Event has taken place\");\r\n            txtView.setTextSize(25);\r\n            txtView.setGravity(Gravity.CENTER);\r\n            txtView.setTextColor(R.color.colorAccent);\r\n         }\r\n      });\r\n    }\r\n}<\/pre>\n<p><strong>Step 4:\u00a0<\/strong> Now open <strong>color.xml<\/strong> in this order &#8211; app &gt; src&gt;main&gt;res&gt;values&gt;colors.xml<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;?xml version=\"1.0\" encoding=\"utf-8\"?&gt;\r\n&lt;resources&gt;\r\n   &lt;color name=\"colorPrimary\"&gt;#008577&lt;\/color&gt;\r\n   &lt;color name=\"colorPrimaryDark\"&gt;#00574B&lt;\/color&gt;\r\n   &lt;color name=\"colorAccent\"&gt;#D81B60&lt;\/color&gt;\r\n\r\n&lt;\/resources&gt;<\/pre>\n<p><strong>Step 5:<\/strong>\u00a0 After writing the above codes, we can happily run the application.<\/p>\n<p>After you run the application, the following would be as follows:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-1.png\"><img loading=\"lazy\" decoding=\"async\" class=\"wp-image-76213 size-medium aligncenter\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-1-169x300.png\" alt=\"Android Event\" width=\"169\" height=\"300\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-1-169x300.png 169w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-1-84x150.png 84w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-1-768x1365.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-1-576x1024.png 576w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-1-520x924.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-1.png 1080w\" sizes=\"auto, (max-width: 169px) 100vw, 169px\" \/><\/a><\/p>\n<p>Now, we will click and see how the onClick() method reacts when we click.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-76237\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-2-169x300.png\" alt=\"android event 2\" width=\"169\" height=\"300\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-2-169x300.png 169w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-2-84x150.png 84w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-2-768x1365.png 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-2-576x1024.png 576w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-2-520x924.png 520w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/Android-Event-2.png 900w\" sizes=\"auto, (max-width: 169px) 100vw, 169px\" \/><\/a><\/p>\n<h2>Summary<\/h2>\n<p>Here we come to the end of our article. We have completed another topic of Android that was Event Handling. I hope you have understood it pretty well. I would also like you all to try and make an application on your own as well. Event Handling is such fun. In this article, we learned about the three main concepts of Event Handling as well as the callback methods. I hope you all liked it.<\/p>\n<p>Thank you for reading our article. Do share your feedback through the comment section below.<span hidden class=\"__iawmlf-post-loop-links\" data-iawmlf-links=\"[{&quot;id&quot;:1184,&quot;href&quot;:&quot;https:\\\/\\\/www.ibm.com\\\/support\\\/knowledgecenter\\\/STPVGU_7.8.1\\\/com.ibm.storage.svc.console.781.doc\\\/svc_svcnavbuttn_223fth.html&quot;,&quot;archived_href&quot;:&quot;&quot;,&quot;redirect_href&quot;:&quot;https:\\\/\\\/www.ibm.com\\\/docs\\\/STPVGU_7.8.1\\\/com.ibm.storage.svc.console.781.doc\\\/svc_svcnavbuttn_223fth.html&quot;,&quot;checks&quot;:[],&quot;broken&quot;:false,&quot;last_checked&quot;:null,&quot;process&quot;:&quot;done&quot;}]\"><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Event handling comes with Event and Handling. The event here is nothing but an Action. Handling here means managing. In the whole Android Event Handling, all we do is manage the actions. These actions&#46;&#46;&#46;<\/p>\n","protected":false},"author":10,"featured_media":76220,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18722],"tags":[21958,21955,21957,21959,21961,21956,21962,21960],"class_list":["post-76153","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android-event-handler","tag-android-event-handling","tag-android-event-listner","tag-android-event-registration","tag-android-handling-focus","tag-event-handling-in-android","tag-implementing-android-event-handling","tag-touchmode-in-android"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Event Handling - Manage the Action of Users Interaction - DataFlair<\/title>\n<meta name=\"description\" content=\"Android Event Handling - Understand in detail about Event Handling in Android &amp; explore its 3 main concepts &amp; know how to implement event handling in Android..\" \/>\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-event-handling\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Event Handling - Manage the Action of Users Interaction - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Android Event Handling - Understand in detail about Event Handling in Android &amp; explore its 3 main concepts &amp; know how to implement event handling in Android..\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/android-event-handling\/\" \/>\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-20T08:57:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-25T08:25:36+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling.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=\"7 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Event Handling - Manage the Action of Users Interaction - DataFlair","description":"Android Event Handling - Understand in detail about Event Handling in Android & explore its 3 main concepts & know how to implement event handling in Android..","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-event-handling\/","og_locale":"en_US","og_type":"article","og_title":"Android Event Handling - Manage the Action of Users Interaction - DataFlair","og_description":"Android Event Handling - Understand in detail about Event Handling in Android & explore its 3 main concepts & know how to implement event handling in Android..","og_url":"https:\/\/data-flair.training\/blogs\/android-event-handling\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-02-20T08:57:14+00:00","article_modified_time":"2021-08-25T08:25:36+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling.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":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/android-event-handling\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/android-event-handling\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33"},"headline":"Android Event Handling &#8211; Manage the Action of Users Interaction","datePublished":"2020-02-20T08:57:14+00:00","dateModified":"2021-08-25T08:25:36+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-event-handling\/"},"wordCount":957,"commentCount":0,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-event-handling\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling.jpg","keywords":["Android Event Handler","Android Event Handling","Android Event Listner","Android Event Registration","Android Handling Focus","Event Handling in Android","Implementing Android Event Handling","Touchmode in Android"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/android-event-handling\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/android-event-handling\/","url":"https:\/\/data-flair.training\/blogs\/android-event-handling\/","name":"Android Event Handling - Manage the Action of Users Interaction - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-event-handling\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-event-handling\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling.jpg","datePublished":"2020-02-20T08:57:14+00:00","dateModified":"2021-08-25T08:25:36+00:00","description":"Android Event Handling - Understand in detail about Event Handling in Android & explore its 3 main concepts & know how to implement event handling in Android..","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/android-event-handling\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/android-event-handling\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/android-event-handling\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/02\/android-event-handling.jpg","width":802,"height":420,"caption":"event handling in android"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/android-event-handling\/#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 Event Handling &#8211; Manage the Action of Users Interaction"}]},{"@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\/76153","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=76153"}],"version-history":[{"count":15,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/76153\/revisions"}],"predecessor-version":[{"id":76393,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/76153\/revisions\/76393"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/76220"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=76153"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=76153"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=76153"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}