<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>activities examples - Wikitechy</title>
	<atom:link href="https://www.wikitechy.com/interview-questions/tag/activities-examples/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.wikitechy.com/interview-questions/tag/activities-examples/</link>
	<description>Interview Questions</description>
	<lastBuildDate>Wed, 15 Sep 2021 06:19:36 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://www.wikitechy.com/interview-questions/wp-content/uploads/2025/10/cropped-wikitechy-icon-32x32.png</url>
	<title>activities examples - Wikitechy</title>
	<link>https://www.wikitechy.com/interview-questions/tag/activities-examples/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Android Activity Lifecycle &#124; android lifecycle</title>
		<link>https://www.wikitechy.com/interview-questions/android/android-activity-lifecycle/</link>
					<comments>https://www.wikitechy.com/interview-questions/android/android-activity-lifecycle/#respond</comments>
		
		<dc:creator><![CDATA[Editor]]></dc:creator>
		<pubDate>Sun, 11 Jul 2021 04:58:44 +0000</pubDate>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Accenture interview questions and answers]]></category>
		<category><![CDATA[activities examples]]></category>
		<category><![CDATA[activity android]]></category>
		<category><![CDATA[activity life cycle in android]]></category>
		<category><![CDATA[activity lifecycle]]></category>
		<category><![CDATA[activity lifecycle android]]></category>
		<category><![CDATA[activity lifecycle in android]]></category>
		<category><![CDATA[Agreeya Solutions interview questions and answers]]></category>
		<category><![CDATA[Allstate Solutions Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[android account manager]]></category>
		<category><![CDATA[android activity]]></category>
		<category><![CDATA[android activity example]]></category>
		<category><![CDATA[android activity lifecycle]]></category>
		<category><![CDATA[android activity lifecycle diagra]]></category>
		<category><![CDATA[android activity lifecycle onsaveinstancestate]]></category>
		<category><![CDATA[android adb driver]]></category>
		<category><![CDATA[android adb interface driver]]></category>
		<category><![CDATA[android add widget]]></category>
		<category><![CDATA[android advanced tutorial]]></category>
		<category><![CDATA[android alertdialog example]]></category>
		<category><![CDATA[android api]]></category>
		<category><![CDATA[android app development]]></category>
		<category><![CDATA[android app store]]></category>
		<category><![CDATA[android application lifecycle]]></category>
		<category><![CDATA[android apps]]></category>
		<category><![CDATA[android apps download]]></category>
		<category><![CDATA[android authority]]></category>
		<category><![CDATA[android button style]]></category>
		<category><![CDATA[android developer]]></category>
		<category><![CDATA[android development]]></category>
		<category><![CDATA[android development tutorial]]></category>
		<category><![CDATA[android device]]></category>
		<category><![CDATA[android download]]></category>
		<category><![CDATA[android emulator]]></category>
		<category><![CDATA[android intent example]]></category>
		<category><![CDATA[android lifecycle]]></category>
		<category><![CDATA[android ndk]]></category>
		<category><![CDATA[android programming]]></category>
		<category><![CDATA[android sdk]]></category>
		<category><![CDATA[android sdk download]]></category>
		<category><![CDATA[android service]]></category>
		<category><![CDATA[android service lifecycle]]></category>
		<category><![CDATA[android software]]></category>
		<category><![CDATA[android studio tutorial]]></category>
		<category><![CDATA[android system]]></category>
		<category><![CDATA[android tutorial]]></category>
		<category><![CDATA[android update android]]></category>
		<category><![CDATA[android versions]]></category>
		<category><![CDATA[android video]]></category>
		<category><![CDATA[apps for android]]></category>
		<category><![CDATA[Bharti Airtel interview questions and answers]]></category>
		<category><![CDATA[Bosch India Software interview questions and answers]]></category>
		<category><![CDATA[Capgemini interview questions and answers]]></category>
		<category><![CDATA[CASTING NETWORKS INDIA PVT LIMITED interview questions and answers]]></category>
		<category><![CDATA[CGI Group Inc interview questions and answers]]></category>
		<category><![CDATA[Chetu interview questions and answers]]></category>
		<category><![CDATA[Collabera Technologies interview questions and answers]]></category>
		<category><![CDATA[Dell International Services India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[developer android]]></category>
		<category><![CDATA[eclipse android]]></category>
		<category><![CDATA[Electronics Arts Inc interview questions and answers]]></category>
		<category><![CDATA[Flipkart interview questions and answers]]></category>
		<category><![CDATA[fragment lifecycle]]></category>
		<category><![CDATA[fragment lifecycle in android]]></category>
		<category><![CDATA[G-Cube Webwide Software Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[google android]]></category>
		<category><![CDATA[google io]]></category>
		<category><![CDATA[IBM interview questions and answers]]></category>
		<category><![CDATA[Indecomm Global Services interview questions and answers]]></category>
		<category><![CDATA[Infosys Technologies interview questions and answers]]></category>
		<category><![CDATA[intent in android]]></category>
		<category><![CDATA[kodi app]]></category>
		<category><![CDATA[Lava International Ltd interview questions and answers]]></category>
		<category><![CDATA[life cycle of activity in android]]></category>
		<category><![CDATA[Maintec Technologies Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[Mphasis interview questions and answers]]></category>
		<category><![CDATA[mservice lifecycle in android]]></category>
		<category><![CDATA[oncreate in android]]></category>
		<category><![CDATA[onresume android]]></category>
		<category><![CDATA[Oracle Corporation interview questions and answers]]></category>
		<category><![CDATA[PeopleStrong interview questions and answers]]></category>
		<category><![CDATA[Photon Interactive Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[poweramp]]></category>
		<category><![CDATA[Prokarma Softech Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[SAP Labs India Pvt Ltd interview questions and answers]]></category>
		<category><![CDATA[service lifecycle android]]></category>
		<category><![CDATA[Symphony Teleca interview questions and answers]]></category>
		<category><![CDATA[Tech Mahindra interview questions and answers]]></category>
		<category><![CDATA[UnitedHealth Group interview questions and answers]]></category>
		<category><![CDATA[what is activity in android]]></category>
		<category><![CDATA[what is android]]></category>
		<category><![CDATA[what is manifest.xml in android?android phones best android phone]]></category>
		<category><![CDATA[Wipro interview questions and answers]]></category>
		<guid isPermaLink="false">https://www.wikitechy.com/interview-questions/?p=104</guid>

					<description><![CDATA[Answer : An activity represents a single screen with a user interface...]]></description>
										<content:encoded><![CDATA[<div class="ImageContent">
<div class="hddn" style="text-align: justify;"><img decoding="async" class="img-responsive center-block" src="https://cdn.wikitechy.com/tutorials/android/android-activity-lifecycle.gif" alt="Android activity lifecycle" /></div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="what-is-android-activity" class="color-red">What is Android Activity</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li style="list-style-type: none;">
<ul>
<li>An activity represents a single screen with a user interface just like window or frame of Java .Android activity is the subclass of <a href="https://www.wikitechy.com/tutorials/android/android-context-menu" target="_blank" rel="noopener">Context</a> Theme Wrapper class.
<ul>
<li>Activities are a fundamental building block of Android applications and they can exist in a number of different states.</li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="ImageContent">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/life-cycle-of-activity-in-android.png" alt=" life cycle of activity in android" /></div>
</div>
<ul>
<li style="list-style-type: none;">
<ul>
<li>The activity lifecycle begins with instantiation and ends with destruction, and includes many states in between.</li>
<li>When an activity changes state, the appropriate lifecycle event method is called, notifying the activity of the impending state change and allowing it to execute code in order to adapt to that change.</li>
<li>Android Activity Lifecycle is controlled by 7 methods of android.app.Activity class.</li>
<li>An activity is the single screen in android. It is like window or frame of Java.</li>
<li>By the help of activity, you can place all your UI components or widgets in a single screen.</li>
<li>The 7 lifecycle method of Activity describes how activity will behave at different states.</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="TextHeading" style="text-align: justify;">
<div class="hddn">
<h2 id="android-activity-lifecycle-methods" class="color-green">Android Activity Lifecycle methods</h2>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Let&#8217;s see the 7 lifecycle methods of android activity.</li>
</ul>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<table class="table-bordered table-striped table table-responsive" style="height: 426px;" width="508">
<tbody>
<tr>
<th class="text-center">Method</th>
<th class="text-center">Description</th>
</tr>
<tr>
<td class="text-leftalign">onCreate</td>
<td class="text-leftalign">called when activity is first created.</td>
</tr>
<tr>
<td class="text-leftalign">onStart</td>
<td class="text-leftalign">called when activity is becoming visible to the user.</td>
</tr>
<tr>
<td class="text-leftalign">onResume</td>
<td class="text-leftalign">called when activity will start interacting with the user.</td>
</tr>
<tr>
<td class="text-leftalign">onPause</td>
<td class="text-leftalign">called when activity is not visible to the user.</td>
</tr>
<tr>
<td class="text-leftalign">onStop</td>
<td class="text-leftalign">called when activity is no longer visible to the user.</td>
</tr>
<tr>
<td class="text-leftalign">onRestart</td>
<td class="text-leftalign">called after your activity is stopped, prior to start.</td>
</tr>
<tr>
<td class="text-leftalign">onDestroy</td>
<td class="text-leftalign">called before the activity is destroyed.</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/oncreate-in-android.png" alt=" oncreate in android" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>It provides the details about the invocation of life cycle methods of activity. In this example, we are displaying the content on the logcat.
<ul>
<li>File: MainActivity.java</li>
</ul>
</li>
</ul>
</div>
</div>
<div class="CodeContent" style="text-align: justify;">
<div class="hddn">
<figure class="highlight"><div class="code-embed-wrapper"> <div class="code-embed-infos"> </div> <pre class="language-javascript code-embed-pre line-numbers"  data-start="1" data-line-offset="0"><code class="language-javascript code-embed-code">package com.example.activitylifecycle;  <br/>import android.os.Bundle;  <br/>import android.app.Activity;  <br/>import android.util.Log;  <br/>import android.view.Menu;  <br/>public class MainActivity extends Activity {  <br/>    @Override  <br/>    protected void onCreate(Bundle savedInstanceState) {  <br/>        super.onCreate(savedInstanceState);  <br/>        setContentView(R.layout.activity_main);  <br/>        Log.d(&quot;lifecycle&quot;,&quot;onCreate invoked&quot;);  <br/>    }  <br/>    @Override  <br/>    protected void onStart() {  <br/>        super.onStart();  <br/>         Log.d(&quot;lifecycle&quot;,&quot;onStart invoked&quot;);  <br/>    }  <br/>    @Override  <br/>    protected void onResume() {  <br/>        super.onResume();  <br/>         Log.d(&quot;lifecycle&quot;,&quot;onResume invoked&quot;);  <br/>    }  <br/>    @Override  <br/>    protected void onPause() {  <br/>        super.onPause();  <br/>         Log.d(&quot;lifecycle&quot;,&quot;onPause invoked&quot;);  <br/>    }  <br/>    @Override  <br/>    protected void onStop() {  <br/>        super.onStop();  <br/>         Log.d(&quot;lifecycle&quot;,&quot;onStop invoked&quot;);  <br/>    }  <br/>       @Override  <br/>    protected void onRestart() {  <br/>        super.onRestart();  <br/>         Log.d(&quot;lifecycle&quot;,&quot;onRestart invoked&quot;);  <br/>    }     <br/>    @Override  <br/>    protected void onDestroy() {  <br/>        super.onDestroy();  <br/>         Log.d(&quot;lifecycle&quot;,&quot;onDestroy invoked&quot;);  <br/>    }  <br/>} </code></pre> </div></figure>
</div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>You will not see any output on the emulator or device. You need to open logcat.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/android-adb-driver.png" alt=" android adb driver" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Now see on the logcat: on Create, on Start and on Resume methods are invoked.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/android-add-widget.png" alt=" android add widget" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Now click on the HOME Button. You will see on Pause method is invoked.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/android-intent-example.png" alt=" android intent example" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>After a while, you will see on Stop method is invoked.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/activity-android.png" alt=" activity android" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Now see on the emulator. It is on the home. Now click on the center button to launch the app again.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/activity-in-android.png" alt=" activity in android" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Now click on the lifecycle activity icon.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/android-broadcastreceiver.png" alt=" android broadcastreceiver" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Now see on the logcat: on Restart, on Start and on Resume methods are invoked.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/androidmanifest-xml.png" alt=" androidmanifest xml" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>If you see the emulator, application is started again.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/alogcat.png" alt=" alogcat" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>Now click on the back button. Now you will see onPause methods is invoked.</li>
</ul>
</div>
</div>
<div class="ImageContent" style="text-align: justify;">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/android-activity-life-cycle.png" alt=" android activity life cycle" /></div>
</div>
<div class="Content" style="text-align: justify;">
<div class="hddn">
<ul>
<li>After a while, you will see onStop and onDestroy methods are invoked.</li>
</ul>
</div>
</div>
<div class="ImageContent">
<div class="hddn"><img decoding="async" class="img-responsive center-block aligncenter" src="https://cdn.wikitechy.com/tutorials/android/life-cycle-of-android.png" alt=" life cycle of android" /></div>
</div>
]]></content:encoded>
					
					<wfw:commentRss>https://www.wikitechy.com/interview-questions/android/android-activity-lifecycle/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
