Sending data from nested fragments to parent fragment

后端 未结 8 2027
情深已故
情深已故 2020-11-27 12:27

I have a Fragment FR1 that contains several Nested Fragments; FRa, FRb, FRc. These

8条回答
  •  孤城傲影
    2020-11-27 12:51

    Check for instanceOf before getting parent fragment which is better:

    if (getParentFragment() instanceof ParentFragmentName) {
      getParentFragment().Your_parent_fragment_method();
    }
    

提交回复
热议问题