Android - multiple OnClickListener?

前端 未结 5 2215
-上瘾入骨i
-上瘾入骨i 2021-02-20 03:39

I have 4 images. We should be able to click on these images. I\'d like to know if I have to create 4 OnClickListener, or there is another way to do this properly?

5条回答
  •  旧时难觅i
    2021-02-20 03:40

    To make any view listen to our action you have to attach listener to that view. So you need to attach four listeners. Attaching OnclickListener and writing implementation both are two different things

提交回复
热议问题