Scenario: you want to show a new Fragment via a click listener from within an adapter or view holder. Below are the two most common, decoupled approaches that I have seen in the past. I have noticed that they both tend to come with their own pros and cons.
Which approach do you generally prefer?
- Invoke a method on an interface that the Activity listens to.
- Publish an event that the Activity is subscribed to (event bus).
- Some other approach.
Please be willing to share why.