Thursday, April 7, 2011

Android Activity Life Cycle on different cases

After published a game on market place, I decided to strengthen my knowledge of Android again.

First, start from Activity Life Cycle. Though the developer site of official Android explained the life cycle of activity with a lot text, it is still a little confusing or not clear enough. Thus I test it through by set break points during the whole life cycle. This is the result.

New Start:
onCreate(),
onStart(),
onResume().

Rotate Device:
onSaveInstanceState(),
onPause(),
onStop(),
onDestroy(),
onCreate(),
onStart(),
onRestoreInstanceState(),
onResume().

Other activity overlayed(e.g.Home button pressed,Calls in or other activity opened):
onSaveInstanceState(),
onPause(),
onStop().

Back from other activity(Not destroyed yet):
onRestart(),
onStart(),
onResume().

Back button pressed/finish() called:
onPause(),
onStop(),
onDestroy().

Screen Off:
onSaveInstanceSave(),
onPause().

Screen back on:
onResume().

7 comments:

  1. Very good brief and this post helped me alot. Say thank you I searching for your facts. Thanks for sharing with us!
    python training in tambaram | python training in annanagar | python training in jayanagar

    ReplyDelete
  2. Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging
    Online DevOps Certification Course - Gangboard
    Best Devops Training institute in Chennai

    ReplyDelete
  3. Wow it is really wonderful and awesome thus it is very much useful for me to understand many concepts and helped me a lot. it is really explainable very well and i got more information from your blog.

    rpa training in velachery| rpa training in tambaram |rpa training in sholinganallur | rpa training in annanagar| rpa training in kalyannagar

    ReplyDelete
  4. Thanks you for sharing this unique useful information content with us. Really awesome work. keep on blogging
    Java training in Chennai | Java training in Bangalore

    Java online training | Java training in Pune

    ReplyDelete