I have a situation in an Android app where I want to start a network activity (sending out some data) which should run every second. I achieve this as follows:
In th
You can simplify the code like this.
In Java:
new Handler().postDelayed (() -> { //your code here }, 1000);
In Kotlin:
Handler().postDelayed({ //your code here }, 1000)