Practical 1 : Android Activity Life Cycle in Android App Development - IndianTechnoEra
Latest update Android YouTube

Practical 1 : Android Activity Life Cycle in Android App Development


Aim

Write a program to study the life cycle of android activity.

What is the cycle of activity?

The cycle of activity refers to the completion of an entire activity from beginning, to the middle, to the end.


An Android activity goes through six major life cycle stages or callbacks. These activities are: onCreate(), onStart(), onResume() , onPause() , onStop() , and onDestroy().

Code:

MainActivity.java

activity_main.xml

Output:

Output on Android Studio:

Start App         : onCreate >> onStart >> onResume

Home App       : onPause >> onStop 

Recent App      : onStart >> onResume

Close App        : onPause >> onStop >> onDestroy

Output on Mobile:

 

Practical 1 : Android Activity Life Cycle in Android App Development

Practical 1 : Android Activity Life Cycle in Android App Development

Post a Comment

Feel free to ask your query...
Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.