onSaveInstanceState

open fun onSaveInstanceState(outState: Bundle)

The onSaveInstanceState method gets called before an orientation change when either the fragment is the current fragment or exists in the fragment manager backstack.