The reason for using documented callbacks and recommended templates is that you will be working with the Android framework, not against it. Using static methods completely circumvents this and looks simple, but there are problems at two levels.
First, from the point of view of object-oriented design, you are closely related classes that have completely different and independent responsibilities, which complicates their reuse and refactoring. The more static methods you introduce into your fragments and activity classes, the worse this problem will be.
Secondly, you work beyond the life cycle for both types of objects, and this will cause you a lot of pain. Firstly, fragments are destroyed and recreated by Android all the time. For example, when you rotate your device, and the screen changes from portrait to landscape, all your fragments are destroyed and created again, because in the landscape you can use different fragments or create different contours in the same fragments. Snippets and actions can also be paused when the user moves to a new action or other application.
Create static methods for fragments and actions, and you can call these methods at any time, and you do not know how much the fragment or activity will be noticeable even when you do it. You do not know at what stage of your life cycle it is if it is part of an ongoing activity, and therefore you are either going to write a lot of additional code to handle this, or not write at all (and have buggies).
Using callbacks also means that in operations with multiple fragments, you can more easily verify that alternative fragments can be used for alternative layouts, and parental activity, deciding which fragment to use, can ensure that data from sister fragments is directed to the correct fragment.
source share