Send data from Activity to Fragment already created

前端 未结 3 1702
北荒
北荒 2020-12-19 00:04

I only have found information about how to create a Fragment sending some data to it, but only in its instantiation with the constructor.

But I want to know if it is

3条回答
  •  生来不讨喜
    2020-12-19 00:30

    Just add a method in Fragment which you want to receive arguments, then invoke the method in Activity.

    Activity's Code:



    Fragment's Code:

提交回复
热议问题