FragmentActivity onSaveInstanceState not getting called

前端 未结 3 1625
醉话见心
醉话见心 2020-12-05 02:49

I have seen a few similar questions about onSaveInstanceState not getting called for Fragments, but in my case Fragments work fine, it

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-05 03:42

    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);
    }
    

提交回复
热议问题