its fun learning to develop with android studio and I've got some of the basics down. But I have a question that I cant find an answer to.
all I want is one button to start adding a fixed number to a total (starting with 0 or another fixed amount), then another button to stop it from adding.
I am using java not kotlin but I can switch if its easier. I know how to use setOnClickListener and declare buttons and textviews, integers and booleans. I'm just a newb with coding. I know Timer and setScheduled should be used but I cant get the hang of it.
example:
start,
total:0
every 300 milliseconds, add 12.
total:
12
24
36
48... etc.
thanks in advance to any help.
all I want is one button to start adding a fixed number to a total (starting with 0 or another fixed amount), then another button to stop it from adding.
I am using java not kotlin but I can switch if its easier. I know how to use setOnClickListener and declare buttons and textviews, integers and booleans. I'm just a newb with coding. I know Timer and setScheduled should be used but I cant get the hang of it.
example:
start,
total:0
every 300 milliseconds, add 12.
total:
12
24
36
48... etc.
thanks in advance to any help.