I want to wait 5 seconds before starting another public void method. The thread sleep was not working for me. If there is a way of wait() without using Threads I wo
wait()
This works for me: val handler = Handler() handler.postDelayed({ // your code to run after 2 second }, 2000)
This works for me:
val handler = Handler() handler.postDelayed({ // your code to run after 2 second }, 2000)