Question

I am having a problem with Android java.util.concurrent.Executors.

I am trying to use newSingleThreadScheduledExecutor to run my runnable every x seconds. I saw executor.scheduleAtFixedRate(myTask, 0, 50, TimeUnit.MILLISECONDS); however it doesn't exists in Android.

The Android documentation link , does not give a clue how I should use the newSingleThreadScheduledExecutor;

Could someone give me an example how I should use it to run a runnable every x seconds? I know you can use Handler, but I am wondering how you can use SingleThreadScheduledExecutor to do the same.

Thanks in advance.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top