Another approach is to skip android:onClick, instead calling
setOnClickListener() on the Button object in Java code. When a Button is used
directly by an activity, this is not typically used — android:onClick is a bit cleaner.
However, when we start to talk about fragments, you will see that android:onClick
does not work that well with fragments, and so we will use setOnClickListener() at
that point.