Inspired Android Developer Guide I am trying to write code in which all fragments are autonomous (in terms of network / logic) and any actions that they perform (click / tap) that should lead to the launch of a new action / fragment will be delegated to activity ( via callback).
For a start, this seemed right. But now that I have fragments that have more than 1 such widgets (which need a fragment to go to a new screen), it seems like a mess. I need to either write some callbacks or make some switch-case logic in the Activity for different actions on the fragment.
If this design sounds bad, what are the scenarios in which implementing callbacks (as suggested by management) would be a good idea?
source
share