onSaveInstanceState

open fun onSaveInstanceState(@NonNull outState: Bundle)

Called by the activity if it requires the fragment to save its state. Since this method can also be called when the fragment is on the backstack and has no view, this method may not rely on any views being present at the time of calling.