This is ultimately a matter of communication and reuse.
If you use the sample code that you posted in your question, yours Fragmentcannot be reused with other actions. It is tightly bound . This is fine if you are working on your own and you don’t think that someone can ever use or read your code later (including yourself), and that you definitely won’t need to use this Fragmentsomewhere else. But generally speaking, you should still use the correct template, just to get used to using it.
If you have an encoding of a position in a company in which “loose communication” will help you and your colleagues in the long run, and you can return to your code and reuse it later than projects if necessary.