To define the click event handler for a button, add the android onClick attribute to the Button element in your XML layout. The value for this attribute must be the name of the method you want to call in response to a click event. The Activity hosting the layout must then implement the corresponding method.
En esta página del sitio puede ver el video en línea Adding code to a Button Click in Android Studio (Java ) de Duración hora minuto segunda en buena calidad , que subió el usuario Vlad Voytenko 10 enero 2019, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 83,750 veces y le gustó 536 a los espectadores. Disfruta viendo!