Different States of an Android Activity

+156 Bucky Roberts · December 19, 2014

   protected void onStart() {
       Log.i(TAG, "onStart");

   protected void onResume() {
       Log.i(TAG, "onResume");

   protected void onPause() {
       Log.i(TAG, "onPause");

   protected void onStop() {
       Log.i(TAG, "onStop");

   protected void onRestart() {
       Log.i(TAG, "onRestart");

   protected void onDestroy() {
       Log.i(TAG, "onDestroy");

   protected void onSaveInstanceState(Bundle outState) {
       Log.i(TAG, "onSaveInstanceState");

   protected void onRestoreInstanceState(Bundle savedInstanceState) {
       Log.i(TAG, "onRestoreInstanceState");

Post a Reply


- page 1
Oldest  Newest  Rating
+4 jan burg · December 19, 2014
Thanks man, this is pretty useful. Is this some foreshadowing of some new android/java development tutorials to look forward to? :)
0 Troy Jones · December 19, 2014
I seen this on the developers site.  I believe it mentioned something about only needing to use onStop(), onStart() and onDestroy() as the other one's the activity automatically cycles through.
0 Samiul Masuk · February 10, 2015
0 Sharad Gupta · February 22, 2015
Thanks for the Source Code. Just began watching tutorials. They are awesome :) !!
+5 Carl Barlow · March 1, 2015
onDasher(), onDancer(), ...
Took me a while to find this post with the source code, but otherwise I'm loving this video series!
+1 Kenny Dexter · March 17, 2015
WOw......and What a Wow


your tutorials are dope , i'm just speechless!:sick:
+2 Shreyans Mulkutkar · March 18, 2015
I added Log messages to my source code, but don't know why its not throwing onCreate, onStart, etc. messages when my App comes up on my emulater. Even added the log message filter. Still not seeing it. 
Can someone point out what is that thing I'm doing wrong?
Thanks in advance.
0 Lasith Niroshan · April 9, 2015
Thanks for codings...:)
0 Oleg Zigalenko · April 15, 2015
Hi Shreyans Mulkutkar. I had a similar problem and I could not see the log messages. After doing a little research this is what worked for me: 

-Change Log Level from Verbose to Debug
-Change Log Level from Debug to Verbose (basically it just resets it)
  (Make sure that your filter is set to your correct name that you created)
-Then click the Restart button on the left side of the log window (looks like a gray box with green arrow)
It will restart the log and wait about 10 seconds and it should show up. 

If it still does not work then please look at this link as it has more solutions to the same problem. 


Good luck and happy coding. 
0 Sandesh uttarwar · June 14, 2015
thank you for this...!

Java / Android Development


Very popular language used to create desktop applications, website applets, and Android apps.

Bucky Roberts Administrator