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

前端 未结 7 501
情话喂你
情话喂你 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 05:09

    This exception is thrown whenever a FragmentTrasaction is commited after FragmentManager has saved its state. The easy and clean way is to check if FragmentManager has already saved state before showing a DialogFragment.

    if(!getSupportFragmentManager.isStateSaved()) {
        MyDialogFragment dialogFragment = new MyDialogFragment()
        dialogFragment.show(getSupportFragmentManager, TAG);
    }
    
    0 讨论(0)
提交回复
热议问题