How to use one function for many blocks

hi i need to use 1 function in many events
let’s say for example i need to show a notification when a user click on a button
just need to use “when button click” and place my notification
but what if i have many buttons like 70 buttons ? should i do it one by one or there’s another way to do it quickly?

Create a procedure, or use the anyComponent blocks (any button clicked event)

There’s no other way? Because using procedure won’t change anything since you’ll need to place it in every event
And anycomponent u’ll have to write the components names it will be easier to place it by yourself in events that wat

Here are some sample projects for you to read that do what you want ...

(A bad example, written before generic events became available ...)

Better ...

Another ...

Lastly, if you don't mind browsing github projects ...

No, it will work for any button - you would need to exclude buttons you didn't want the activity to run