lundi 6 juin 2016

Reusing a fragment from activity and inner fragment

The usual method to interact the parent activity with the enclosing fragment is via an interface that the parent activity implements.
If the fragment is reused from another activity then interface would be implemented if needed and it would work fine.
Question: What if the fragment is reused as an inner fragment of another fragment?
How would this pattern of communication be adapted? It doesn't seem very straightforward if I implement the interface in the parent activity when it is one of the enclosing fragment that contains it.
Is there another approach?

Aucun commentaire:

Enregistrer un commentaire