Apps ac.addOnClickedListener (AC Add On Clicked Listener) - How to use it?

Hello, I am trying to make AC app and cannot figure out how to make working button. I have the button itself, but it doesn't seem to be doing anything. I noticed that all app makers use ac.addOnClickedListener in their code so I was wondering what it is and how to use it. Oh yeah also its arguments.
 
It provides a callback function that the button then uses. Arguments are first the id of the button, then the callback. Look up event-driven programming to get an idea how this is done.

The callback function needs to have arguments matching the type of button it is. Although python also has the general purpose "*args" / "**kwargs" notation that absorbs any remaining arguments, so you may see those in code.
 

Latest News

What would make you race in our Club events

  • Special events

    Votes: 52 27.7%
  • More leagues

    Votes: 33 17.6%
  • Prizes

    Votes: 36 19.1%
  • Trophies

    Votes: 21 11.2%
  • Forum trophies

    Votes: 11 5.9%
  • Livestreams

    Votes: 28 14.9%
  • Easier access

    Votes: 103 54.8%
  • Other? post your reason

    Votes: 30 16.0%
Back
Top