Android Advance Go Back Creating a Function for Buttons. views 6:23 Now we will acquire the reference for the 9 buttons. At the same time we will also implement OnClickListener() for these buttons. You will remember that when an OnClickListener() listener is implemented for a button, then an event is generated when the button is pressed and the function linked to that event is called. Activities, Intents and Activity lifecycle Showing User Name in login page. Creating Buttons in app. Creating a Function for Buttons. Creating Conditional Function.