Basic communication between two fragments

前端 未结 10 2335
我寻月下人不归
我寻月下人不归 2020-11-22 05:00

I have one activity - MainActivity. Within this activity I have two fragments, both of which I created declaratively within the xml.

I am trying to pas

10条回答
  •  我寻月下人不归
    2020-11-22 05:35

    Learn " setTargetFragment() "

    Where " startActivityForResult() " establishes a relationship between 2 activities, " setTargetFragment() " defines the caller/called relationship between 2 fragments.

提交回复
热议问题