Android have deprecated setRetainInstance ()
of a androidx.fragment.app.Fragment
class HomeFragment: Fragment (){
override fun onCreate(savedInstanceState:
Bundle?){
super.onCreate(savedInstanceState)
retainInstance = true//deprecated
}
}
How do I retain the fragment state being that this method is deprecated
code language KOTLIN
I've read this thread
Why use Fragment#setRetainInstance(boolean)? it doesn't answer the question.
I've been trying to implement the android documentation recommendation to no avail. what I need is a code snippet of a solution