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.
Nesta página do site você pode assistir ao vídeo on-line Adding code to a Button Click in Android Studio (Java ) duração hora minuto segundo em boa qualidade , que foi baixado pelo usuário Vlad Voytenko 10 Janeiro 2019, compartilhe o link com seus amigos e conhecidos, no youtube este vídeo já foi visto 83,750 vezes e gostou 536 espectadores. Boa visualização!