diff options
author | Scott Jackson <daneren2005@gmail.com> | 2015-04-28 17:45:51 -0700 |
---|---|---|
committer | Scott Jackson <daneren2005@gmail.com> | 2015-04-28 17:45:51 -0700 |
commit | 0f801b780e82943bde5b3e7d96af1c6b29ba4edc (patch) | |
tree | 857a4cb719a8c66aa9647fc700edfe21d8916e7f /app/src/main | |
parent | a72e12ae06fafe1885aa763ffa04faa84afb9523 (diff) | |
download | dsub-0f801b780e82943bde5b3e7d96af1c6b29ba4edc.tar.gz dsub-0f801b780e82943bde5b3e7d96af1c6b29ba4edc.tar.bz2 dsub-0f801b780e82943bde5b3e7d96af1c6b29ba4edc.zip |
Fix background update running on hidden NowPlayingFragment
Diffstat (limited to 'app/src/main')
-rw-r--r-- | app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java index 953b429a..80183c40 100644 --- a/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java +++ b/app/src/main/java/github/daneren2005/dsub/fragments/NowPlayingFragment.java @@ -832,7 +832,11 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis @Override public void onResume() { super.onResume(); - onResumeHandlers(); + if(this.primaryFragment) { + onResumeHandlers(); + } else { + update(); + } } private void onResumeHandlers() { final Handler handler = new Handler(); @@ -894,11 +898,14 @@ public class NowPlayingFragment extends SubsonicFragment implements OnGestureLis onPauseHandlers(); } private void onPauseHandlers() { - executorService.shutdown(); - if(getDownloadService() != null) { - getDownloadService().stopRemoteScan(); + if(executorService != null) { + executorService.shutdown(); + if (getDownloadService() != null) { + getDownloadService().stopRemoteScan(); + } + executorService = null; + playlistFlipper.setDisplayedChild(0); } - playlistFlipper.setDisplayedChild(0); } @Override |