onSaveInstanceState

abstract fun onSaveInstanceState(outState: Bundle)

You must call this method from the parent Activity/Fragment's corresponding method. Provides a Bundle to store the state of the View before it gets destroyed. It can later be retrieved when onCreate(Bundle) is called again.