From e17f51685e633ca2fff6512cf44e87ad660aa396 Mon Sep 17 00:00:00 2001 From: Scott Jackson Date: Mon, 24 Mar 2014 20:14:07 -0700 Subject: When looping back to start, start first in stopped position instead of null --- src/github/daneren2005/dsub/service/DownloadService.java | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/github/daneren2005') diff --git a/src/github/daneren2005/dsub/service/DownloadService.java b/src/github/daneren2005/dsub/service/DownloadService.java index 8220f6f0..a4d2c508 100644 --- a/src/github/daneren2005/dsub/service/DownloadService.java +++ b/src/github/daneren2005/dsub/service/DownloadService.java @@ -728,9 +728,15 @@ public class DownloadService extends Service { play(index, start, 0); } private synchronized void play(int index, boolean start, int position) { - if (index < 0 || index >= size()) { + int size = this.size(); + if (index < 0 || index >= size) { reset(); - setCurrentPlaying(null, false); + if(index >= size && size != 0) { + setCurrentPlaying(0, false); + Util.hidePlayingNotification(this, this, handler); + } else { + setCurrentPlaying(null, false); + } lifecycleSupport.serializeDownloadQueue(); } else { if(nextPlayingTask != null) { -- cgit v1.2.3