I just begin developing with Android. The first challenge that I am facing now is how to save the fragment data when changing between fragment using a BottomNavigationController (Generated automatically by Android Studio)
I have tried using ViewModel, but since onDestroy() is being called every time when switches, the data is also lost. onSaveInstanceState() is not being called when switching the fragment neither.
Many methods or solutions I saw online use deprecated functions (Since I am just a beginner, I have no idea what is the new function being used right now)
I hope someone can help me with this! Thanks!