{"id":148,"date":"2026-06-03T06:25:07","date_gmt":"2026-06-03T06:25:07","guid":{"rendered":"https:\/\/gigz.pk\/javaapp\/?post_type=lesson&#038;p=148"},"modified":"2026-06-06T11:37:09","modified_gmt":"2026-06-06T11:37:09","slug":"event-handling","status":"publish","type":"lesson","link":"https:\/\/gigz.pk\/javaapp\/?lesson=event-handling","title":{"rendered":"Event Handling"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Event Handling is one of the most important concepts in Android app development. It allows applications to respond to user interactions such as button clicks, screen touches, text input, menu selections, and other actions. Without event handling, an Android application would only display information and would not be able to interact with users.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Modern Android applications rely heavily on event handling to create dynamic, interactive, and user-friendly experiences.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is Event Handling?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Event Handling is the process of detecting and responding to user actions or system-generated events within an application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">An event occurs whenever a user interacts with the application or when a specific system action takes place.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Examples of events include:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Button clicks<\/li>\n\n\n\n<li>Screen touches<\/li>\n\n\n\n<li>Text input<\/li>\n\n\n\n<li>Menu selections<\/li>\n\n\n\n<li>Checkbox selections<\/li>\n\n\n\n<li>Activity lifecycle changes<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Event handling allows developers to define what should happen when these events occur.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Why is Event Handling Important?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Event handling is important because it:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Makes applications interactive<\/li>\n\n\n\n<li>Responds to user actions<\/li>\n\n\n\n<li>Improves user experience<\/li>\n\n\n\n<li>Enables dynamic functionality<\/li>\n\n\n\n<li>Supports application logic<\/li>\n\n\n\n<li>Creates responsive interfaces<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Without event handling, Android applications would not be able to react to user input.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is an Event?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An event is an action that triggers a response from the application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Examples:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>User presses a button<\/li>\n\n\n\n<li>User enters text<\/li>\n\n\n\n<li>User selects a menu item<\/li>\n\n\n\n<li>User touches the screen<\/li>\n\n\n\n<li>User checks a checkbox<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Each event can execute specific code defined by the developer.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What is an Event Listener?<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">An Event Listener is an object that waits for an event to occur and executes code when the event is triggered.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Android uses listeners to handle most user interactions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Examples of listeners:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>OnClickListener<\/li>\n\n\n\n<li>OnLongClickListener<\/li>\n\n\n\n<li>OnTouchListener<\/li>\n\n\n\n<li>OnCheckedChangeListener<\/li>\n\n\n\n<li>TextWatcher<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Listeners help developers respond to user actions efficiently.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Button Click Event<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Button clicks are among the most common events in Android applications.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">XML Layout<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;Button\n    android:id=\"@+id\/btnSubmit\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:text=\"Submit\" \/&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Java Code<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>Button btnSubmit =\n        findViewById(R.id.btnSubmit);\n\nbtnSubmit.setOnClickListener(v -&gt; {\n\n    System.out.println(\"Button Clicked\");\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When the user clicks the button, the code inside the listener executes.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Understanding OnClickListener<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">OnClickListener is used to handle click events.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>btnSubmit.setOnClickListener(v -&gt; {\n\n    \/\/ Action here\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This listener waits for the user to press the button and then performs the specified action.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Displaying a Message on Click<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Button btnClick =\n        findViewById(R.id.btnClick);\n\nbtnClick.setOnClickListener(v -&gt; {\n\n    Toast.makeText(\n            this,\n            \"Button Clicked\",\n            Toast.LENGTH_SHORT\n    ).show();\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">A message appears when the button is pressed.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Handling Multiple Buttons<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Applications often contain multiple buttons.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Button btnAdd =\n        findViewById(R.id.btnAdd);\n\nButton btnDelete =\n        findViewById(R.id.btnDelete);\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Each button can have its own listener.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>btnAdd.setOnClickListener(v -&gt; {\n\n    System.out.println(\"Add\");\n\n});\n\nbtnDelete.setOnClickListener(v -&gt; {\n\n    System.out.println(\"Delete\");\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This allows different actions for different buttons.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Long Click Events<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">A Long Click occurs when a user presses and holds a component.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>button.setOnLongClickListener(v -&gt; {\n\n    System.out.println(\"Long Click\");\n\n    return true;\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Long-click events are commonly used for advanced options and context menus.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Touch Events<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Touch events detect screen interactions.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>view.setOnTouchListener(\n        (v, event) -&gt; {\n\n    System.out.println(\"Touched\");\n\n    return true;\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Touch events are frequently used in games and custom UI components.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">EditText Event Handling<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Applications often respond to text entered by users.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">XML Example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;EditText\n    android:id=\"@+id\/edtName\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\" \/&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Reading Input on Button Click<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>EditText edtName =\n        findViewById(R.id.edtName);\n\nButton btnSubmit =\n        findViewById(R.id.btnSubmit);\n\nbtnSubmit.setOnClickListener(v -&gt; {\n\n    String name =\n            edtName.getText()\n                    .toString();\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This retrieves user input when the button is clicked.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Text Change Events<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">TextWatcher monitors changes inside an EditText.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>edtName.addTextChangedListener(\n        new TextWatcher() {\n\n    @Override\n    public void onTextChanged(\n            CharSequence s,\n            int start,\n            int before,\n            int count) {\n\n    }\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This event is useful for search bars and live validation.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">CheckBox Event Handling<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">CheckBox components can trigger events when selected or deselected.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">XML Example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;CheckBox\n    android:id=\"@+id\/checkTerms\"\n    android:layout_width=\"wrap_content\"\n    android:layout_height=\"wrap_content\"\n    android:text=\"Accept Terms\" \/&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Java Example<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>CheckBox checkTerms =\n        findViewById(\n                R.id.checkTerms);\n\ncheckTerms.setOnCheckedChangeListener(\n        (buttonView, isChecked) -&gt; {\n\n    if(isChecked) {\n\n        System.out.println(\n                \"Checked\");\n\n    }\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This event detects changes in checkbox state.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">RadioButton Event Handling<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">RadioButtons allow users to select one option from a group.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>radioButton.setOnClickListener(v -&gt; {\n\n    System.out.println(\n            \"Option Selected\");\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">RadioButton events are common in surveys and forms.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Menu Item Events<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Menu selections can also trigger events.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Example:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>@Override\npublic boolean onOptionsItemSelected(\n        MenuItem item) {\n\n    if(item.getItemId()\n            == R.id.menu_settings) {\n\n        return true;\n\n    }\n\n    return super.onOptionsItemSelected(item);\n\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This handles menu interactions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Event Handling Using Methods<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Android also allows event handling through methods.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">XML<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;Button\n    android:onClick=\"showMessage\"\n    android:text=\"Click Me\" \/&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Java<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>public void showMessage(View view) {\n\n    System.out.println(\n            \"Button Clicked\");\n\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This connects the button directly to a Java method.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Complete Event Handling Example<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">XML Layout<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;LinearLayout\n    xmlns:android=\"http:\/\/schemas.android.com\/apk\/res\/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"&gt;\n\n    &lt;EditText\n        android:id=\"@+id\/edtName\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:hint=\"Enter Name\"\/&gt;\n\n    &lt;Button\n        android:id=\"@+id\/btnSubmit\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"Submit\"\/&gt;\n\n&lt;\/LinearLayout&gt;\n<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Java Code<\/h3>\n\n\n\n<pre class=\"wp-block-code\"><code>EditText edtName =\n        findViewById(R.id.edtName);\n\nButton btnSubmit =\n        findViewById(R.id.btnSubmit);\n\nbtnSubmit.setOnClickListener(v -&gt; {\n\n    String name =\n            edtName.getText()\n                    .toString();\n\n    Toast.makeText(\n            this,\n            \"Hello \" + name,\n            Toast.LENGTH_SHORT\n    ).show();\n\n});\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When the user enters a name and clicks the button, a greeting message appears.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Real-World Applications<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Event handling is used in:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Login systems<\/li>\n\n\n\n<li>Registration forms<\/li>\n\n\n\n<li>Shopping applications<\/li>\n\n\n\n<li>Banking apps<\/li>\n\n\n\n<li>Social media platforms<\/li>\n\n\n\n<li>Mobile games<\/li>\n\n\n\n<li>Educational applications<\/li>\n\n\n\n<li>Healthcare systems<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Every Android application relies on event handling.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Common Beginner Mistakes<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Forgetting Listener Registration<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Incorrect:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Button button =\n        findViewById(R.id.button);\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Without a listener, the button does nothing.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Missing Component IDs<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">UI components must have IDs to be accessed in Java code.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Null Pointer Errors<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Always ensure components exist before using them.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Ignoring Input Validation<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Validate user input before processing events.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Best Practices<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When implementing event handling:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Use meaningful method names<\/li>\n\n\n\n<li>Keep event logic simple<\/li>\n\n\n\n<li>Validate user input<\/li>\n\n\n\n<li>Avoid duplicate listeners<\/li>\n\n\n\n<li>Handle exceptions properly<\/li>\n\n\n\n<li>Test all user interactions<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">These practices improve application quality and maintainability.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Importance of Event Handling<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Event handling is important because it:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Creates interactive applications<\/li>\n\n\n\n<li>Connects users with app functionality<\/li>\n\n\n\n<li>Supports dynamic behavior<\/li>\n\n\n\n<li>Improves user experience<\/li>\n\n\n\n<li>Enables real-time responses<\/li>\n\n\n\n<li>Forms the foundation of Android interaction<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">It is one of the core skills every Android developer must master.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Event Handling enables Android applications to respond to user actions and system events effectively. Through listeners such as OnClickListener, OnTouchListener, TextWatcher, and OnCheckedChangeListener, developers can create dynamic and interactive applications that provide meaningful user experiences. Mastering event handling is essential for building professional Android applications because it connects user interactions with application functionality and brings interfaces to life.<\/p>\n\n\n<div class=\"yoast-breadcrumbs\"><span><span><a href=\"https:\/\/gigz.pk\/javaapp\">Home<\/a><\/span> \u00bb <span class=\"breadcrumb_last\" aria-current=\"page\">Java for Android Apps > App Logic with Java > Event Handling<\/span><\/span><\/div>\n\n\n<div class=\"schema-faq wp-block-yoast-faq-block\"><\/div>\n","protected":false},"menu_order":47,"template":"","class_list":["post-148","lesson","type-lesson","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Event Handling - Learn Java used for Apps with GiGz.PK<\/title>\n<meta name=\"description\" content=\"Learn Android event handling \u2014 button clicks, listeners, touch events, EditText input, and complete examples for interactive apps.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/gigz.pk\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Event Handling - Learn Java used for Apps with GiGz.PK\" \/>\n<meta property=\"og:description\" content=\"Learn Android event handling \u2014 button clicks, listeners, touch events, EditText input, and complete examples for interactive apps.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/gigz.pk\/\" \/>\n<meta property=\"og:site_name\" content=\"Learn Java used for Apps with GiGz.PK\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-06T11:37:09+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":[\"WebPage\",\"FAQPage\"],\"@id\":\"https:\\\/\\\/gigz.pk\\\/javaapp\\\/?lesson=event-handling\",\"url\":\"https:\\\/\\\/gigz.pk\\\/\",\"name\":\"Event Handling - Learn Java used for Apps with GiGz.PK\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/javaapp\\\/#website\"},\"datePublished\":\"2026-06-03T06:25:07+00:00\",\"dateModified\":\"2026-06-06T11:37:09+00:00\",\"description\":\"Learn Android event handling \u2014 button clicks, listeners, touch events, EditText input, and complete examples for interactive apps.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/gigz.pk\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/gigz.pk\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/gigz.pk\\\/javaapp\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Java for Android Apps > App Logic with Java > Event Handling\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/gigz.pk\\\/javaapp\\\/#website\",\"url\":\"https:\\\/\\\/gigz.pk\\\/javaapp\\\/\",\"name\":\"Learn Java used for Apps with GiGz.PK\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/gigz.pk\\\/javaapp\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Event Handling - Learn Java used for Apps with GiGz.PK","description":"Learn Android event handling \u2014 button clicks, listeners, touch events, EditText input, and complete examples for interactive apps.","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:\/\/gigz.pk\/","og_locale":"en_US","og_type":"article","og_title":"Event Handling - Learn Java used for Apps with GiGz.PK","og_description":"Learn Android event handling \u2014 button clicks, listeners, touch events, EditText input, and complete examples for interactive apps.","og_url":"https:\/\/gigz.pk\/","og_site_name":"Learn Java used for Apps with GiGz.PK","article_modified_time":"2026-06-06T11:37:09+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":["WebPage","FAQPage"],"@id":"https:\/\/gigz.pk\/javaapp\/?lesson=event-handling","url":"https:\/\/gigz.pk\/","name":"Event Handling - Learn Java used for Apps with GiGz.PK","isPartOf":{"@id":"https:\/\/gigz.pk\/javaapp\/#website"},"datePublished":"2026-06-03T06:25:07+00:00","dateModified":"2026-06-06T11:37:09+00:00","description":"Learn Android event handling \u2014 button clicks, listeners, touch events, EditText input, and complete examples for interactive apps.","breadcrumb":{"@id":"https:\/\/gigz.pk\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/gigz.pk\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/gigz.pk\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/gigz.pk\/javaapp"},{"@type":"ListItem","position":2,"name":"Java for Android Apps > App Logic with Java > Event Handling"}]},{"@type":"WebSite","@id":"https:\/\/gigz.pk\/javaapp\/#website","url":"https:\/\/gigz.pk\/javaapp\/","name":"Learn Java used for Apps with GiGz.PK","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/gigz.pk\/javaapp\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/gigz.pk\/javaapp\/index.php?rest_route=\/wp\/v2\/lesson\/148","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/gigz.pk\/javaapp\/index.php?rest_route=\/wp\/v2\/lesson"}],"about":[{"href":"https:\/\/gigz.pk\/javaapp\/index.php?rest_route=\/wp\/v2\/types\/lesson"}],"wp:attachment":[{"href":"https:\/\/gigz.pk\/javaapp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=148"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}