Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- val handler = Handler(Looper.getMainLooper())
- val runnable = object : Runnable {
- override fun run() {
- if (countProgress.progress > 0) {
- val new_time = countProgress.progress.toInt() - 1
- timeLabel.text = "$new_time segundos"
- countProgress.progress = new_time
- }
- handler.postDelayed(this, 1000)
- }
- }
- playCount.setOnClickListener() {
- handler.postDelayed(runnable, 1000)
- }
- pauseCount.setOnClickListener() {
- handler.removeCallbacks(runnable)
- }
Add Comment
Please, Sign In to add comment