1

At some point in my code a swipe refresh layout is disabled. I use:

swipe_refresh_layout.isEnabled = false

Then I want to set a timer for it to be re-enabled after some seconds. I have tried the solutions given in this question. How to call a method after a delay in Android

What i am currently using is the code below and the log message appears but I can't refresh.

val r = Runnable {
    Log.d("Test", "Re-enable refresher..")
    swipe_refresh_layout.isEnabled = true
}
Handler().postDelayed(r, 1000)

Can someone help as to what I might be doing wrong. Thanks

andy
  • 193
  • 1
  • 9

0 Answers0