java.lang.IllegalStateException: Failure saving state: active has cleared index in fragment

前端 未结 3 1226
别跟我提以往
别跟我提以往 2021-02-13 04:51

First, my app has structure like this:

 SpashActivity -> MainActivity -> switching between many fragments

My app use SlideMenu to switch

3条回答
  •  我寻月下人不归
    2021-02-13 05:36

    Try to change

     @Override
    public void onBackPressed() {
        if (0 == getSupportFragmentManager().getBackStackEntryCount()) {
    

    to

     @Override
    public void onBackPressed() {
        if (getSupportFragmentManager().getBackStackEntryCount() < 1 ) {
    

    I hope this works

提交回复
热议问题