Failure saving state - target not in fragment manager (setTargetFragment)

后端 未结 8 1428
北荒
北荒 2020-12-23 14:06

I\'ve got a monkey crash whereby

java.lang.IllegalStateException: Failure saving state: FragmentB has target not in fragment manager: FragmentA
at android.s         


        
8条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-23 14:37

    In my case the issue was about calling setTargetFragment on wrong Fragment.

    Was: FragmentA.setTargetFragment(FragmentB);

    Should be: FragmentB.setTargetFragment(FragmentA);

提交回复
热议问题