The official android documentation suggests that passing data from a fragment to an activity should be done by defining an interface in the fragment, and then implementing it in the activity.
However, say you have a fragment that is used by more than one activity, and that you need to pass the data only to a certain activity. Since this is Java, this solution requires I implement the interface for all of the activities, which is not a viable solution IMHO.
What methods are available and recommended to pass data from a fragment only to a certain activity?