It turns out that I have 2 menus on the screen, one horizontal and one vertical made with Linearlayouts, and at least I have 15 buttons. My query is ... Is there any pattern or optimization that you use so that you do not have to do the setOnClickListener in onCreate ()?
For example, before I used a Toolbar with a menu, then easily with an item.getItemId () and a switch solved it. But now I have to one by one relate the view with the controller and to each one set an OnCLickListener, and I seem to be repeating a lot of code since in OnClick I only call another function.
I hope you can help me! Thanks!