Monday, January 23, 2017


onCreate():

  • Called when the activity is first created. 
  • This is where you should do all of your normal static set up create views, bind data to lists, an d so on.
  • Always followed by onStart()

onRestart():

  • Called after the activity has been stopped, just prior to it bein g started again. 
  • Always followed by onStart()

onStart():

  • Called just before the activity becomes visible to the user.
  • Followed by onResume() if the activity comes to the foreground, or onStop() if it becomes hidden.

onResume():

  •  Called just before the activity starts interacting with the user. 
  •  At this point the activity is at the top of the activity stack, with user input going to it. 
  • Always followed by onPause().

Activity Running:

  • It is active or running when it is in the foreground of the screen (at the top of the activity stack for the current task). 
  • This is the activity that is the focus for the user's actions.

onPause():

  •  Called when the system is about to start resuming another activity. 
  •  This method is typically used to commit unsaved changes to persistent data, stop animations and other things that may be consuming CPU, and so on. 
  • It should do whatever it does very quickly, because the next activity will not be resumed until it returns. 
  • Followed either by onResume() if the activity returns back t o the front, or by onStop() if it becomes invisible to the user. The activity in this state is killable by the system.

onStop():

  • Called when the activity is no longer visible to the user. 
  • This may happen because it is being destroyed, or because another activity (either an existing one or a new one) has been resumed and is covering it.
  •  Followed either by onRestart() if the activity is coming back to interact with the user, or by onDestroy() if this activity is going away. 
  • The activity in this state is killable by the system.

onDestroy():

  • Called when the activity is no longer visible to the user. 
  •  This may happen because it is being destroyed, or because another activity (either an existing one or a new one) has been resumed and is covering it. 
  • Followed either by onRestart() if the activity is co ming back to interact with the user, or by onDest roy() if this activity is going away. 
  • The activity in this state is killable by the system.

Life Cycle Functions:

 @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");
    }

70 comments:

  1. Thanks a lot very much for the high quality and results-oriented help.
    I won’t think twice to endorse your blog post to anybody who wants
    and needs support about this area. We provide Android training realtime Experts Android Training

    ReplyDelete
  2. The blog taught lots of information. Thank you for the information.
    mobile app development in india

    ReplyDelete
  3. thank you sir you are providing a very useful material

    ReplyDelete
  4. This comment has been removed by the author.

    ReplyDelete
  5. very useful post kindly share such content android training

    ReplyDelete
  6. I’m really amazed with your posting skills as well as with the layout on your blog site. We are top Mobile App Development Company in Delhi.

    ReplyDelete
  7. Nice article admin thanks for share your article keep share your knowledge i am waiting for your new post check nursing dresses boys t shirts kindly review and reply me

    ReplyDelete
  8. I really appreciate your post. It is very interesting and helpfull too. Keep posting.

    Android Training Course in Delhi

    ReplyDelete
  9. I thought protecting the website from the hackers is a hectic task. This post makes it easy for the developers and business people to protect the website. Keep sharing posts like this…
    Hire Web Developer
    Hire Wordpress Programmer
    Hire PHP Developer India
    Mobile App Development India
    Hire Opencart Developer

    ReplyDelete
  10. Great Blog posts. This post is very helpful for me. If you looking best and reliable Application Development Company. Contact Us Now.

    ReplyDelete
  11. Thank you so much for this nice topic I have not a lot of information about it but I have got an extra unique info in this post.
    App Development Company

    ReplyDelete
  12. The article was up to the point and described the information very effectively. Thanks to blog author for wonderful and informative post.
    website designing Pakistan

    ReplyDelete
  13. Very nice and helpful blog. Thanks for sharing.
    Android course

    ReplyDelete
  14. This comment has been removed by the author.

    ReplyDelete
  15. This comment has been removed by the author.

    ReplyDelete
  16. Thank you for this informative and helpful article. It really gave me a lot of information, hope that you’ll continue to create articles like this.

    Data Science course in bangalore marathahalli
    Spark Training in Marathahalli

    ReplyDelete
  17. You described so easily about Mobile apps Development. Thanks a lot for sharing this useful information. Have a nice day!

    ReplyDelete

  18. Thanks for sharing Such a valuable post and for more information. please follow the link-App development companies

    ReplyDelete
  19. Looking For Flutter App Development Flutter is Google's mobile UI framework for crafting high-quality native interfaces on iOS and Android in record time. With the release of Flutter 1.12 version, the programming language has been updated from Dart 2.5 to Dart 2.7. It is expected to supply excellent development and user experience.

    ReplyDelete
  20. Great set of tips from the master himself. Excellent ideas. App Builder 2020.67 Crack

    ReplyDelete
  21. Thank you for writing this post. Looking forward to read more.
    Android App Development Services India

    ReplyDelete
  22. Flutter mobile app development is a trending topic that has convinced many developers to work on it. With its advanced and easy to implement feature allows renowned apps such as Facebook and Instagram to use it in their business apps. The rat Dart uses AOT(Ahead-of-Time) and JIT(Just-in-time) compilationio of Flutter app development companies is increasing day by day. But do you think it has all the features you need for your perfect mobile app development? Let’s find out the advantages and its disadvantages to make our decision better.

    ReplyDelete

  23. Very help full blog, for sharing content and such nice information for me. I hope you will share some more content about. Please keep sharing! Hire Flutter Developer

    ReplyDelete
  24. This comment has been removed by the author.

    ReplyDelete
  25. These are helpful codes while undertaking Android app development. An alternative to this process is to use a Mobile App Builder. With simple yet useful features such as drag & drop, unlimited editing & real-time preview, developers can build apps within a matter of days.

    ReplyDelete
  26. These codes might help app developers who are just starting their app development careers. However, developers can take advantage of a mobile app builder to build apps since they require no code-writing. Additionally, the simple features like drag & drop, realtime preview & unlimited editing make the entire app development process smooth & quick.

    ReplyDelete
  27. I Like your post, It informative for every user, Thanks for share it, Keep it up,
    App Builder 2020.86 Plus Crack

    ReplyDelete
  28. Amazing post. Widle Studio is one of the best Flutter App Developer in Florida, United States. It develops Apps for all types of screen.

    ReplyDelete
  29. This comment has been removed by the author.

    ReplyDelete
  30. This comment has been removed by the author.

    ReplyDelete
  31. Informative post! I am planning to use a No code mobile app development platform to accelerate mobile app building & deployment times.

    ReplyDelete
  32. Thanks for sharing such a great step by step process. It will use many people who are into Mobile and Android app development.

    Mobile app development company in Toronto
    Mobile app development company in canada
    app development companies toronto

    ReplyDelete
  33. Excellent post! Farm sector can definitely use a booking app that enables customers to directly book an appointment with farmers to procure farm produce.

    ReplyDelete
  34. This blog is really amazing this is of much helpful for us .Visit here : android app development companies

    ReplyDelete
  35. Incredible article. I'm managing a portion of these issues too..

    best interiors

    ReplyDelete
  36. This comment has been removed by the author.

    ReplyDelete
  37. Really nice way to present your blog and information is also too good. Thanks for sharing it. If you are searching for professional job oriented courses than visit here:-
    Digital Marketing Course In Jaipur
    Web Designing Course In Jaipur
    Python Training in Jaipur
    Data Science Course in Jaipur
    Artificial Intelligence Course In Jaipur
    Online Tally Course

    ReplyDelete
  38. This is an excellent post I seen thanks to share it. It is really what I wanted to see hope in future you will continue for sharing such a excellent post. business analytics course in kanpur

    ReplyDelete
  39. Thank you for sharing your valuable information. The blog/article is very good and informative and I will be recommended this information to my friends. I found one good software testing services company which you should try.

    ReplyDelete
  40. The application is a great boost for your business or startup. After all, all clients are now online. But the quality of this application is of great importance. Therefore, it is important to choose a developer, what you should pay how to find an app developer

    ReplyDelete
  41. I think this is an informative post and it is very useful and knowledgeable.

    On Demand Service Apps For Android and iOS are highly in demand as through this online platform. Do you want to develop On Demand Doctor App? We are leading doctor app development company that provides best Doctor mobile app development.

    ReplyDelete