Actions in onActivityResult and “Error Can not perform this action after onSaveInstanceState”

前端 未结 7 516
情话喂你
情话喂你 2020-12-13 04:41

Implementing an app where the user can log in I have the following situation: If the user is logged in perform the action else start the login activity for result and if the

7条回答
  •  孤城傲影
    2020-12-13 04:59

    Best thing I've come up with is to not use .show() but rather do this.

    CheckinSuccessDialog dialog = new CheckinSuccessDialog();
    //dialog.show(getSupportFragmentManager(), null);
    FragmentTransaction ft = getSupportFragmentManager().beginTransaction();
    ft.add(dialog, null);
    ft.commitAllowingStateLoss();
    

提交回复
热议问题