I have seen a few similar questions about onSaveInstanceState not getting called for Fragments, but in my case Fragments work fine, it
Not an accurate answer to the question, but may help someone's day. In my case, I called
@Override
public void onSaveInstanceState(Bundle outState, PersistableBundle outPersistentState) {
super.onSaveInstanceState(outState, outPersistentState);
}
I replaced the above code as below and things worked
@Override
protected void onSaveInstanceState(@NonNull Bundle outState) {
super.onSaveInstanceState(outState);
}