문제

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.

도움이 되었습니까?
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top