Why i should use the Communicating with Other Fragments pattern when I could simply use
((MyActivity)getActivity()).doFoo();
In my Fragmen
When you call ((MyActivity)getActivity()).doFoo() you are downcasting your object and you could encounter a RuntimeException if the containing Activity isn't a an instance of MyActivity. The direct call means that the Fragment is tightly coupled with the Activity. Many people believe this is not a good thing.
When you implement the interface as described in your link, you won't be able to build your app unless you're passing around an object that has implemented it.
This means that if you use the fragment elsewhere, you eradicate the risk of a RuntimeException because it is strongly typed.
There's a question here explaining why strong typing is good and tight coupling is bad