Sorry for the silly question, but I have a doubt that what is the life cycle of android & what is the life cycle of an activity. Actually in an interview the interviewer has asked me, that what is life cycle of android? and I got confused between life cycle of activity and life cycle of android. Is there any difference between both.?
Asked
Active
Viewed 113 times
0
-
Dupe of: http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for – selbie May 22 '17 at 03:38
-
2Possible duplicate of [Android activity life cycle - what are all these methods for?](http://stackoverflow.com/questions/8515936/android-activity-life-cycle-what-are-all-these-methods-for) – selbie May 22 '17 at 03:38
1 Answers
0
Android the OS does not have a life cycle. The newer versions of the OS allow it to go into various states to protect the battery. but the interviewer probably wanted to know if you knew the Activity lifecycle that every app on Android does.
see Activity lifecycle reference here: https://developer.android.com/guide/components/activities/activity-lifecycle.html
As a bonus they usually ask if you know the fragment lifecycle as well please refer to the documentation here: https://developer.android.com/guide/components/fragments.html
The documentation will be clearer on the different life cycles that occur.

HexBlit
- 1,172
- 1
- 13
- 31