Reputation: 55
Android Repetitive Task here is my code but the sound is not repeated
final Handler handler = new Handler();
Timer timer = new Timer();
TimerTask task = new TimerTask() {
public void run() {
handler.post(new Runnable() {
public void run() {
mPlayer.start();
}
});
}};
timer.schedule(task, 0, 60000);
Upvotes: 1
Views: 223
Reputation: 775
if you use media player, you can use
mPlayer.setLooping(true);
by the way ,your repeat timer task is fine.
Upvotes: 1