I have the code below which is in ONCreate() method of the main activity and works fine. After moving to the next activity (B) which is a list view and then to activity (C ) which is the row selected from the listview and goes to sleep then the ScheduledExecutorService started in the main activity is not executing anymore .
Why is it not executing and how do I fix it? I am noob in Android .Please help me out.
Thanks in Advance .Really appreciate the help.
ScheduledExecutorService executor = Executors.newSingleThreadScheduledExecutor();
executor.scheduleWithFixedDelay(new Runnable(){
public void run() {
//play audio file
mp3.start();
}
}, 0, 60, TimeUnit.SECONDS);