Can someone give a simple example of updating a textfield every second or so?
I want to make a flying ball and need to calculate/update the ball coordinates every se
for whom wants to do this in kotlin:
val timer = fixedRateTimer(period = 1000L) { val currentTime: Date = Calendar.getInstance().time runOnUiThread { tvFOO.text = currentTime.toString() } }
for stopping the timer you can use this:
timer.cancel()
this function has many other options, give it a try