

{"id":74998,"date":"2020-01-29T10:54:23","date_gmt":"2020-01-29T05:24:23","guid":{"rendered":"https:\/\/data-flair.training\/blogs\/?p=74998"},"modified":"2021-08-25T13:55:57","modified_gmt":"2021-08-25T08:25:57","slug":"android-activity","status":"publish","type":"post","link":"https:\/\/data-flair.training\/blogs\/android-activity\/","title":{"rendered":"Android Activity Lifecycle with Callback Methods &amp; Usage"},"content":{"rendered":"<div class='__iawmlf-post-loop-links' style='display:none;' data-iawmlf-post-links='[{&quot;id&quot;:1203,&quot;href&quot;:&quot;https:\\\/\\\/developer.android.com\\\/reference\\\/android\\\/content\\\/Intent&quot;,&quot;archived_href&quot;:&quot;http:\\\/\\\/web-wp.archive.org\\\/web\\\/20251012100734\\\/https:\\\/\\\/developer.android.com\\\/reference\\\/android\\\/content\\\/Intent&quot;,&quot;redirect_href&quot;:&quot;&quot;,&quot;checks&quot;:[{&quot;date&quot;:&quot;2025-12-09 03:11:22&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-13 08:26:05&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-18 13:51:34&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2025-12-22 09:08:20&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-02 06:43:22&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-05 06:44:14&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-08 15:57:17&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-13 14:27:14&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-17 10:11:15&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-21 04:49:18&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-01-31 05:10:49&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-03 07:30:09&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-07 09:11:39&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-12 06:08:17&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-19 01:18:19&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-02-23 22:16:02&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-02 03:34:57&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-05 11:03:23&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-10 04:36:47&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-15 08:07:44&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-03-22 09:36:04&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-02 06:58:37&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-06 07:42:06&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-09 12:53:17&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-15 10:49:56&quot;,&quot;http_code&quot;:429},{&quot;date&quot;:&quot;2026-04-20 06:56:29&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-04-26 10:22:06&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-02 16:30:30&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-06 17:45:03&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-12 05:25:25&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-15 12:05:01&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-18 18:17:15&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-21 23:49:12&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-25 12:15:02&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-05-29 14:02:13&quot;,&quot;http_code&quot;:503},{&quot;date&quot;:&quot;2026-06-08 06:50:34&quot;,&quot;http_code&quot;:503}],&quot;broken&quot;:true,&quot;last_checked&quot;:{&quot;date&quot;:&quot;2026-06-08 06:50:34&quot;,&quot;http_code&quot;:503},&quot;process&quot;:&quot;done&quot;}]'><\/div>\n<p>Android Activity provides users with a frame to interact with &amp; perform their actions. Since an activity interacts with the user, it designs a window to hold UI elements. An interactive application has many activities providing a screen &amp; interacting with each other.<\/p>\n<p>Come let\u2019s see what we\u2019re going to study about Android Activity in this tutorial:<\/p>\n<ul>\n<li>What is Activity<\/li>\n<li>Android Activity Lifecycle<\/li>\n<li>Android Activity Lifecycle Methods<\/li>\n<li>Manifest Attributes of\u00a0Android Activities<\/li>\n<\/ul>\n<h3>What is Activity?<\/h3>\n<p>We know by now, that an activity is a single screen of an application that lets us see and interact to perform an activity. Usually, an application contains many screens and each screen extends <strong>Activity()<\/strong> class.<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75032\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial.jpg\" alt=\"android activity lifecycle\" width=\"802\" height=\"420\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial.jpg 802w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial-150x79.jpg 150w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial-300x157.jpg 300w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial-768x402.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial-520x272.jpg 520w\" sizes=\"auto, (max-width: 802px) 100vw, 802px\" \/><\/a><\/p>\n<p>When we work on an application what we see is a UI on the screen which is an activity. Most of the applications that we use have many activities. Among all those activities, one is the <strong>MainActivity()<\/strong> &amp; the rest are its <strong>ChildActivities()<\/strong>. Generally, the first page that appears on the screen when an application opens is referred to as MainActivity(). This main activity interacts with the child activities and lets the user access them.<\/p>\n<p>Activities are stored in a stack of Activities, wherein the current activity holds the highest position.<\/p>\n<p><em><strong>Before proceeding, let&#8217;s revise the <a href=\"https:\/\/data-flair.training\/blogs\/android-application-components\/\">Android Application Components<\/a><\/strong><\/em><\/p>\n<h2>Android Activity Lifecycle<\/h2>\n<p>An activity can have four states, which are :<\/p>\n<ol>\n<li>Running<\/li>\n<li>Paused<\/li>\n<li>Resumed<\/li>\n<li>Stopped<\/li>\n<\/ol>\n<p>The above are the four states that Android activity can achieve during its whole lifecycle.<\/p>\n<h4>1. Running State<\/h4>\n<p>An activity is in the <strong>running<\/strong> state if it\u2019s shown in the foreground of the users\u2019 screen. Activity is in the running state when the user is interacting with it.<\/p>\n<h4>2. Paused State<\/h4>\n<p>When an activity is not in the focus but is still alive for the user, it\u2019s in a <strong>paused<\/strong> state. The activity comes in this state when some other activity comes in with a higher position in the window.<\/p>\n<h4>3. Resumed State<\/h4>\n<p>It is when an activity goes from the paused state to the foreground that is an <strong>active<\/strong> state.<\/p>\n<h4>4. Stopped State<\/h4>\n<p>When an activity is no longer in the activity stack and <strong>not visible<\/strong> to the users.<\/p>\n<h3>Android Activity Methods<\/h3>\n<p>Android activities go through four states during their entire lifecycle. These activities have callback methods() to describe each activity in each of the four stages. These methods need to be overridden by the implementing subclass. In Android, we have the following 7 callback methods that activity uses to go through the four states:<\/p>\n<ol>\n<li>onCreate()<\/li>\n<li>onStart()<\/li>\n<li>onPause()<\/li>\n<li>onRestart()<\/li>\n<li>onResume()<\/li>\n<li>onStop()<\/li>\n<li>onDestroy()<\/li>\n<\/ol>\n<p>We\u2019ll understand these in the following:<\/p>\n<h4>1. onCreate()<\/h4>\n<p>The Android oncreate() method is called at the very start when an activity is created. An activity is created as soon as an application is opened. This method is used in order to create an Activity.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">@Override protected void onCreate(Bundle savedInstanceState)\r\n{\r\nsuper.onCreate(savedInstanceState);\r\n...\r\n}<\/pre>\n<h4>2. onStart()<\/h4>\n<p>The Android onstart() method is invoked as soon as the activity becomes visible to the users. This method is to start an activity. The activity comes on the forescreen of the users when this method is invoked.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">@Override protected void onStart()\r\n{\r\nsuper.onStart();\r\n...\r\n}<\/pre>\n<h4>3. onPause()<\/h4>\n<p>The Android onPause() method is invoked when the activity doesn\u2019t receive any user input and goes on hold. In the pause state, the activity is partially visible to the user. This is done when the user presses the back or home buttons. Once an activity is in the pause state, it can be followed by either <strong>onResume()<\/strong> or<strong> onStopped()<\/strong> callback method.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">@Override protected void onPause()\r\n{\r\nsuper.onPause();\r\n...\r\n}<\/pre>\n<h4>4. onRestart()<\/h4>\n<p>The Android onRestart() method is invoked when activity is about to start from the stop state. This method is to restart an activity that had been active some time back. When an activity restarts, it starts working from where it was paused.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">@Override protected void onRestart()\r\n{\r\nsuper.onRestart();\r\n...\r\n}<\/pre>\n<h4>5. onResume()<\/h4>\n<p>The Android onResume() method is invoked when the user starts interacting with the user. This callback method is followed by <strong>onPause()<\/strong>. Most of the functionalities of an application are implemented using <strong>onResume()<\/strong>.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">@Override protected void onResume()\r\n{\r\nsuper.onResume();\r\n...\r\n}<\/pre>\n<h4>6. onStop()<\/h4>\n<p>The Android onStop() method is invoked when the activity is no longer visible to the user. The reason for this state is either activity is getting destroyed or another existing activity comes back to <strong>resume<\/strong> state.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">@Override protected void onStop()\r\n{\r\nsuper.onStop();\r\n...\r\n}<\/pre>\n<h4>7. onDestroy()<\/h4>\n<p>The Android onDestroy() is the method that is called when an activity finishes and the user stops using it. It is the final callback method received by activity, as after this it is destroyed.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">@Override protected void onDestroy()\r\n{\r\nsuper.onDestroy();\r\n...\r\n}\r\n<\/pre>\n<p>Understand the flow of Activity through the four states using the seven methods from the diagram:<\/p>\n<p><a href=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-lifecycle.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-75027\" src=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-lifecycle.jpg\" alt=\"android activity lifecycle\" width=\"1116\" height=\"1332\" srcset=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-lifecycle.jpg 1116w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-lifecycle-126x150.jpg 126w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-lifecycle-251x300.jpg 251w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-lifecycle-768x917.jpg 768w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-lifecycle-858x1024.jpg 858w, https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-lifecycle-520x621.jpg 520w\" sizes=\"auto, (max-width: 1116px) 100vw, 1116px\" \/><\/a><\/p>\n<h3>Manifest Attributes of Android Activity<\/h3>\n<p>To implement activities in our application, we need to register them in the Manifest file. For the activities to work properly, we must manage their lifecycle properly. Now let us see the declaration of activities and their attributes in Manifest files. We\u2019ll see the syntax as well, using datflair_activity as an example.<\/p>\n<h4>1. Declare Activities<\/h4>\n<p>For this, the required attribute name is <strong>android:name<\/strong>.<\/p>\n<p>To declare it in the manifest file, simply open the Manifest and type add<strong> &lt;activity&gt;<\/strong> tag under <strong>&lt;application&gt;<\/strong> tag.<\/p>\n<p>The syntax to declare Android activity:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;manifest ... &gt;\r\n  &lt;application ... &gt;\r\n      &lt;activity android:name=\".Dataflair_activity\" \/&gt;\r\n        ...content\u2026.\r\n  &lt;\/application ... &gt;\r\n&lt;\/manifest &gt;<\/pre>\n<p>To declare an activity, we only need one important element that is the name of the activity. We can add certain attributes like UI, label, etc.<\/p>\n<h4>2. Declare Intent filters<\/h4>\n<p>Intents are a very crucial part of an Android application. <a href=\"https:\/\/developer.android.com\/reference\/android\/content\/Intent\">Intents<\/a> let an activity to be launched in other activity or applications. It also provides the advantage of making an implicit or an explicit request.<\/p>\n<p>The syntax is as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;activity android:name=\".Dataflair_Activity\" android:icon=\"@drawable\/app_icon\"&gt;\r\n    &lt;intent-filter&gt;\r\n        &lt;action android:name=\"android.intent.action.SEND\" \/&gt;\r\n        &lt;category android:name=\"android.intent.category.DEFAULT\" \/&gt;\r\n        &lt;data android:mimeType=\"text\/plain\" \/&gt;\r\n    &lt;\/intent-filter&gt;\r\n&lt;\/activity&gt;<\/pre>\n<h4>3. Declare Permissions<\/h4>\n<p>Android activity tag can also control which applications can start activities. For permission, the element that is used is <strong>android:permission<\/strong>. With this, we can put control on the activities, where they can be launched.<\/p>\n<p>The syntax is as follows:<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">&lt;manifest&gt;\r\n&lt;activity\r\nandroid:name=\".dataflair_activity\"\r\nandroid:permission=\u201dcom.google.socialapp.permission.SHARE_POST\u201d\r\n\/&gt;\r\n&lt;manifest\/&gt;<\/pre>\n<h2>Summary<\/h2>\n<p>Now that we\u2019ve discussed so much about Android Activity, I hope you\u2019re now clear with what an Activity is. We also know now, how important it is for an application to manage it properly.<\/p>\n<p><em><strong>Check the <a href=\"https:\/\/data-flair.training\/blogs\/android-books\/\">Best Android Books<\/a> for getting started with Android Development<\/strong><\/em><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android Activity provides users with a frame to interact with &amp; perform their actions. Since an activity interacts with the user, it designs a window to hold UI elements. An interactive application has many&#46;&#46;&#46;<\/p>\n","protected":false},"author":10,"featured_media":75032,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[18722],"tags":[21778,21779,21783,21780,21781,21784,21782,21785],"class_list":["post-74998","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-android","tag-android-activity","tag-android-activity-lifecycle","tag-android-activity-manifest-attributes","tag-android-activity-methods","tag-android-oncreate","tag-android-onresume","tag-android-onstart","tag-android-onstop"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Android Activity Lifecycle with Callback Methods &amp; Usage - DataFlair<\/title>\n<meta name=\"description\" content=\"Android Activity - Learn about the lifecycle of android activity with its methods and manifest attributes explained with syntax.\" \/>\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-activity\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android Activity Lifecycle with Callback Methods &amp; Usage - DataFlair\" \/>\n<meta property=\"og:description\" content=\"Android Activity - Learn about the lifecycle of android activity with its methods and manifest attributes explained with syntax.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/data-flair.training\/blogs\/android-activity\/\" \/>\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-01-29T05:24:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-08-25T08:25:57+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-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=\"6 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android Activity Lifecycle with Callback Methods &amp; Usage - DataFlair","description":"Android Activity - Learn about the lifecycle of android activity with its methods and manifest attributes explained with syntax.","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-activity\/","og_locale":"en_US","og_type":"article","og_title":"Android Activity Lifecycle with Callback Methods &amp; Usage - DataFlair","og_description":"Android Activity - Learn about the lifecycle of android activity with its methods and manifest attributes explained with syntax.","og_url":"https:\/\/data-flair.training\/blogs\/android-activity\/","og_site_name":"DataFlair","article_publisher":"https:\/\/www.facebook.com\/DataFlairWS\/","article_published_time":"2020-01-29T05:24:23+00:00","article_modified_time":"2021-08-25T08:25:57+00:00","og_image":[{"width":802,"height":420,"url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-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":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/data-flair.training\/blogs\/android-activity\/#article","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/android-activity\/"},"author":{"name":"DataFlair Team","@id":"https:\/\/data-flair.training\/blogs\/#\/schema\/person\/a90b082e16aa38d207212d22b0581f33"},"headline":"Android Activity Lifecycle with Callback Methods &amp; Usage","datePublished":"2020-01-29T05:24:23+00:00","dateModified":"2021-08-25T08:25:57+00:00","mainEntityOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-activity\/"},"wordCount":1000,"commentCount":1,"publisher":{"@id":"https:\/\/data-flair.training\/blogs\/#organization"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-activity\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial.jpg","keywords":["android activity","android activity lifecycle","Android Activity Manifest Attributes","android activity methods","android oncreate","Android onResume()","android onstart","Android onStop()"],"articleSection":["Android Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/data-flair.training\/blogs\/android-activity\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/data-flair.training\/blogs\/android-activity\/","url":"https:\/\/data-flair.training\/blogs\/android-activity\/","name":"Android Activity Lifecycle with Callback Methods &amp; Usage - DataFlair","isPartOf":{"@id":"https:\/\/data-flair.training\/blogs\/#website"},"primaryImageOfPage":{"@id":"https:\/\/data-flair.training\/blogs\/android-activity\/#primaryimage"},"image":{"@id":"https:\/\/data-flair.training\/blogs\/android-activity\/#primaryimage"},"thumbnailUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial.jpg","datePublished":"2020-01-29T05:24:23+00:00","dateModified":"2021-08-25T08:25:57+00:00","description":"Android Activity - Learn about the lifecycle of android activity with its methods and manifest attributes explained with syntax.","breadcrumb":{"@id":"https:\/\/data-flair.training\/blogs\/android-activity\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/data-flair.training\/blogs\/android-activity\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/data-flair.training\/blogs\/android-activity\/#primaryimage","url":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial.jpg","contentUrl":"https:\/\/data-flair.training\/blogs\/wp-content\/uploads\/sites\/2\/2020\/01\/android-activity-tutorial.jpg","width":802,"height":420,"caption":"android activity lifecycle"},{"@type":"BreadcrumbList","@id":"https:\/\/data-flair.training\/blogs\/android-activity\/#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 Activity Lifecycle with Callback Methods &amp; Usage"}]},{"@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\/74998","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=74998"}],"version-history":[{"count":5,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/74998\/revisions"}],"predecessor-version":[{"id":75033,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/posts\/74998\/revisions\/75033"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media\/75032"}],"wp:attachment":[{"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/media?parent=74998"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/categories?post=74998"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/data-flair.training\/blogs\/wp-json\/wp\/v2\/tags?post=74998"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}