> For the complete documentation index, see [llms.txt](https://notes.tejpratapsingh.com/_/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://notes.tejpratapsingh.com/_/android-tips/lifecycle/basics/lifecycle/activity.md).

# Activity

Activity lifecycle with saved instance state

* `onCreate()`
  * `onPostCreate()`
* `onStart()`
  * `onRestoreInstanceState()`
* `onResume()`
* `onPause()`
  * `onSaveInstanceSate()`
* `onStop()`
* `onRestart()`
* `onDestroy()`

{% @mermaid/diagram content="---
title: Activity Lifecycle
-------------------------

graph TD
onCreate --> onPostCreate
onPostCreate --> onStart
onCreate --> onStart
onStart -- When there is some saved state --> onRestoreInstanceState
onRestoreInstanceState --> onResume
onStart --> onResume
onResume --> onPause
onPause --> onSaveInstanceState
onSaveInstanceState --> onStop
onStop --> onRestart
onRestart -- Back to activity --> onStart
onStop --> onDestroy
onDestroy -- On Configuration Changed --> onCreate" %}
