I’m just starting with Android, and if you are a beginner like me, you probably want to understand two of main concepts of Android: Activities and Intents. You probably start off with a “Hello, World.”, so in Android that is an Activity. Anything you can see on the screen is handled by an Activity. And Intents are what is used to start other activities (and services). To understand an Activity’s behavior when triggered by Intents and user interactions, it is very important to properly understand the life cycle of an Activity. That is what I’m trying to do. You can find a good description of the life cycle here, but it was a little difficult to find an example code. I finally found in lecture slides of Victor Matos of Cleveland State University here. Below I have put the code, with some parts commented out so that I can easily understand the bare bone stuff. This is just a single Activity, next I’ll try to demo this behavior with two Activities using Intents.
7 comments
Skip to comment form ↓
neeraj
December 12, 2010 at 5:35 am (UTC 0) Link to this comment
Good Explanation, i was searching some thing like this
Parmendra Singh
April 20, 2011 at 4:08 pm (UTC 0) Link to this comment
Really nice explanation of activity cycle for the starters….
srikanth
September 9, 2011 at 1:27 pm (UTC 0) Link to this comment
Really very nice . it is very easy to understand
thanks a lot
Vaibhav Muley
December 7, 2011 at 2:03 pm (UTC 0) Link to this comment
Very very best tutorial. Very good to understand activity life cycle. Change your emulator orientation to get method onRestoreInstanceState(Bundle savedInstanceState) be called.
saurabh
February 24, 2012 at 4:34 am (UTC 0) Link to this comment
nice one and yes androidians rock
Sunil Khunger
September 19, 2012 at 4:50 am (UTC 0) Link to this comment
I like that your way to description of the activity life cycle.
Ananth.V
January 25, 2013 at 7:05 am (UTC 0) Link to this comment
good explatnation for activity
life cycle