Fragment declared target fragment that does not belong to this FragmentManager

前端 未结 3 2113
温柔的废话
温柔的废话 2020-12-29 08:17

I have made an activity A which has a fragment X in it. In fragment X, EditText item has on click event which opens fragment Y. This fragment displays a list of names. I pre

3条回答
  •  [愿得一人]
    2020-12-29 08:33

    In my solution, replace

    getChildFragmentManager()
    

    with

    Activity.getSupportFragmentManager() or Fragment.getFragmentManager()
    

    that worked for me. Thank Mr.Ben P

提交回复
热议问题