About the interpretation and method of setOnClick and other elements in the button click event? And the location and role of toast?

reference links at the end of this article:
tutorials of this code and how to use interfaces, tutorials of switch statements links are links 1.
summary of there are more implementation methods , for link 2.

the links in the text are visually unified, and the links are all at the end of the text. For the convenience of jumping in the text, the jump links in the text are added.

the following code is for me to learn button and simple code related to listeners and click events:

go straight to the code, discussion and consultation tutorials are linked in reference link (if I need to put the tutorial text up):

  five implementations of the Android response onClick method  

Apr.07,2021

1:setOnClickListener is an anonymous inner class

2:Toast is written in the onClick method, onClick is written in the setOnClickListener method, and toast is written in the

in the listener

3: there are many ways to click events. The anonymous inner class is the code in this section, and the interface methods are two commonly used

.

4: maybe setOnClickListener is a callback function, followed by an object instead of a method

still unknown: whether View.OnClickListener is a constructor

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3e431-2bc51.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3e431-2bc51.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?