Android MVP - How to communicate between activity presenter and fragment presenter -


i have activity 3 fragments, use viewpager. want implement mvp , communicate between activity presenter , fragment presenters i.e:

  • passing data activity presenter fragment presenters
  • sending event fragment presenters activity presenter
  • ...

but don't know how in official way. can use busevent don't think it's practice.

as per understanding, usecase, suppose activitya have viewpager having 3 fragments(fragmenta, fragmentb, fragmentc).

activitya have activitypresentera

fragmenta have fragmentpresentera

as per mvp, fragmentpresentera should responsible logical , business flows of fragmenta , should communicate fragmenta only. therefore, fragmentpresentera can not directly communicate activitypresentera.

for communication fragment activity, presenter should not involved , should done communicate in non-mvp architecture, i.e. of interface.

same applies activity fragment communication.

for communication between activity , fragment read here


Comments

Popular posts from this blog

Ansible - ERROR! the field 'hosts' is required but was not set -

customize file_field button ruby on rails -

SoapUI on windows 10 - high DPI/4K scaling issue -