Different States of an Android Activity

+156 Bucky Roberts · December 19, 2014
/images/forum/upload/2014-12-19/5a00eeefae97a8d127f621fdc5ad2ff7.png


   @Override
   protected void onStart() {
       super.onStart();
       Log.i(TAG, "onStart");
   }


   @Override
   protected void onResume() {
       super.onResume();
       Log.i(TAG, "onResume");
   }


   @Override
   protected void onPause() {
       super.onPause();
       Log.i(TAG, "onPause");
   }


   @Override
   protected void onStop() {
       super.onStop();
       Log.i(TAG, "onStop");
   }


   @Override
   protected void onRestart() {
       super.onRestart();
       Log.i(TAG, "onRestart");
   }


   @Override
   protected void onDestroy() {
       super.onDestroy();
       Log.i(TAG, "onDestroy");
   }


   @Override
   protected void onSaveInstanceState(Bundle outState) {
       super.onSaveInstanceState(outState);
       Log.i(TAG, "onSaveInstanceState");
   }


   @Override
   protected void onRestoreInstanceState(Bundle savedInstanceState) {
       super.onRestoreInstanceState(savedInstanceState);
       Log.i(TAG, "onRestoreInstanceState");
   }

Post a Reply

Replies

- page 4
Oldest  Newest  Rating
0 android learner · June 29, 2015
I'm getting error: class, interface or enum expected. What to do?
0 jinu mm · July 7, 2015
Thanks for the Source Code. Just began watching tutorials for   http://www.essayscampus.com  essay writing  
students
0 Osama Bin Zafar · December 22, 2016
hi there!!
              Can any one tell me where can i find all the source codes, 
i am following android tutorials by bucky , the 87 Video tutorial series ..
thanks in advance 
0 Lasith Niroshan · April 9, 2015
Thanks for codings...:)
0 Shakun Bhalla · July 23, 2015
Hi,
I also copied the code that you wrote above but the problem that i am facing is that it shows an error in the "TAG", it says that it has a private access in android.support.v4.app.FragmentActivity.

Kindly help me that as i am stuck with this and am not able to proceed further.

Thank you
0 Daniyar Iman-Zhussip · March 18, 2016
nice man
0 Ankit Agarwal · April 23, 2017
Hi Bucky,

I have recently started to go through your tutorials on the youtube channel. I have already completed the first 9 tutorials and I am now on 8th where we are talking about logs. well I have running all the changes in the AVD and everything was working fine. but now when I embedded changes for logs, I came to notice there are logs being printed even though the app is showing on the AVD manager.

Can you help me on this?/images/forum/upload/2017-02-28/45881698cd796b14a4b2c21a9773c41f.png
0 ANIL TÜFEKÇİ · April 23, 2017
Thanks
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 Hossein Mansouri · October 4, 2015
please fix code view problem in Google Chrome

Java / Android Development

131,212 followers
About

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

Links
Moderators
Bucky Roberts Administrator