Different States of an Android Activity

+122 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 3
Oldest  Newest  Rating
0 Lester Rodriguez · August 29, 2015
You're awesome!
Pretty sweet.
Just having fun with your tutorials
and learning as well.
0 Akshay Pimpalkar · February 3, 2016
i found these question marks on ur code. What does it mean?/images/forum/upload/2016-02-03/0ece4ed455921192ec6688b6269e2896.png 
0 Sharad Gupta · February 22, 2015
Thanks for the Source Code. Just began watching tutorials. They are awesome :) !!
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  
0 Lasith Niroshan · April 9, 2015
Thanks for codings...:)
0 Shakun Bhalla · July 23, 2015
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 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


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

Bucky Roberts Administrator