Closed techyourchance closed 5 years ago
@Override public void onSaveInstanceState(Bundle saveInstanceState) { mFragNavController.onSaveInstanceState(saveInstanceState); }
Where is your super.onSaveInstanceState(saveInstanceState)
calling?
Yes, it was the lack of super.onSaveInstanceState(saveInstanceState)
. What an embarassment!
Thanks for helping @solareye!
First of all - great library. Very nice API and functionality. Said that, we ran into an issue and two developers have already spent hours trying to resolve it, but without much success.
Problem: upon configuration change, the currently shown Fragment is destroyed and detached, but isn't re-created after the Activity is re-created (neither of lifecycle methods of that Fragment are called).
What we tried: we tested the behavior of BottomTabsActivity in the sample app and saw that it works as expected (unlike our app). Then we basically wrote the same code in our app (translated to Java). To our great surprise, this didn't resolve the issue.
Our current code (stripped down to just the relevant parts):
As I wrote above, when I start the app, I see "collections" screen. If I then rotate the device, the Activity is re-created, but the space devoted to "content" Fragment remains blank and I see that neither of Fragment's lifecycle methods get called. The behavior of the BottomTabsActivity in the sample app is different (it works as expected), but we just can't understand what we did differently.
We spent hours trying to eliminate many various factors one-by-one, but couldn't find the problem. Help will be greatly appreciated.