I have created this in onCreate() and after I press home button ; ScheduledExecutorService does not run every 10 mins in the background.Why ?
Where is the mistake.
Please help me out .
Thanks in Advance.
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
executor.scheduleWithFixedDelay(new Runnable(){
public void run() {
//play music to check if it executes every 10 mins
mp3.start();
}
}, 0, 600, TimeUnit.SECONDS);