I tried this code And Logged. But I thought I can see title text = 0 and then sleep 1 second and see text 1 and sleep and so on... But that was not. When I run this code, I just see text=3 after 4 second sleep. How to understand this? sleep method just stop UI process And don't stop background process?
for (i in 0..3) {
Log.d("TAG"," i : "+i)
binding.title.text = "current="+i
SystemClock.sleep(1000)
//Thread.sleep(1000)
}