Difference between OnClick() event and OnClickListener?

后端 未结 16 2423
醉话见心
醉话见心 2020-12-01 12:13

I\'m always using onclick() event in most of my projects. But, I read about OnClickListener(). Can anyone tell what\'s the difference between these

16条回答
  •  鱼传尺愫
    2020-12-01 12:53

    OnClickListener is what waits for someone to actually click, onclick determines what happens when someone clicks

    the listener is a class, the onclick is a method, this distinction is not very useful in simple cases, but if you want to be more complicated it becomes more necessary

提交回复
热议问题