What is the use of OnClickListener in Android?

Mỹ Duyên

New member
What is the use of OnClickListener in Android?
Answer
In Android, the OnClickListener() interface has an onClick(View v) method that is called when the view (component) is clicked. The code for a component’s functionality is written inside this method, and the listener is set using the setOnClickListener() method.
 

Tìm kiếm

Back
Top