getting exception “IllegalStateException: Can not perform this action after onSaveInstanceState”

前端 未结 30 2100
迷失自我
迷失自我 2020-11-22 05:12

I have a Live Android application, and from market i have received following stack trace and i have no idea why its happening as its not happening in application code but it

30条回答
  •  情话喂你
    2020-11-22 06:01

    Short And working Solution :

    Follow Simple Steps :

    Step 1 : Override onSaveInstanceState state in respective fragment. And remove super method from it.

    @Override
    public void onSaveInstanceState(Bundle outState) {
    };
    

    Step 2 : Use CommitAllowingStateLoss(); instead of commit(); while fragment operations.

    fragmentTransaction.commitAllowingStateLoss();
    

提交回复
热议问题