I have several buttons in a view that call the method addNumero in OnClick, something like this:
<Button
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_weight="1"
android:gravity="center"
android:onClick="addNumero"
android:text="8" />
And since there are many buttons, it is impractical to use setOnClickListener
in each.
I have a class that inherits from fragment: public class Exemplo extends Fragment
and this class inflates the view that contains the buttons and in this class is also the addNumero
method but it is not working, when I click do not call the addNumber.