Reputation: 439
I am trying to implement the following functionality in my application
Can anybody please advise me on the best way to implementing this other than using the alarm manager?
Upvotes: 0
Views: 2025
Reputation: 18107
final Timer timer = new Timer();
final TimerTask task = new TimerTask() {
@Override
public void run() {
MediaPlayer mp = new MediaPlayer();
mp.setDataSource(PATH_TO_FILE);
mp.prepare();
mp.start();
}
};
timer.schedule(task, delay);
Upvotes: 1