ViewPager Activity to notify a Fragment of a specific event

后端 未结 6 1480
无人及你
无人及你 2020-12-08 02:59

I have a ViewPager and it is using a FragmentAdapter in order to display several fragments of the same kind. Although these Fragments are basicall

6条回答
  •  隐瞒了意图╮
    2020-12-08 03:16

    I don't know enough of what you are doing, but it sounds like you need to use an Observer pattern, Callbacks, or Listeners. Can't your fragment just do somthing like:

    myservice.addMyEventListener(myFragInstance);
    

    and then you can be "notified of a specific event."

提交回复
热议问题