aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/github/daneren2005/dsub/fragments/MainFragment.java11
-rw-r--r--src/github/daneren2005/dsub/util/compat/RemoteControlClientJB.java11
2 files changed, 18 insertions, 4 deletions
diff --git a/src/github/daneren2005/dsub/fragments/MainFragment.java b/src/github/daneren2005/dsub/fragments/MainFragment.java
index fb36c9e3..0e1b587e 100644
--- a/src/github/daneren2005/dsub/fragments/MainFragment.java
+++ b/src/github/daneren2005/dsub/fragments/MainFragment.java
@@ -254,9 +254,16 @@ public class MainFragment extends SubsonicFragment {
private void setActiveServer(int instance) {
if (Util.getActiveServer(context) != instance) {
- DownloadService service = getDownloadService();
+ final DownloadService service = getDownloadService();
if (service != null) {
- service.clearIncomplete();
+ new SilentBackgroundTask<Void>(context) {
+ @Override
+ protected Void doInBackground() throws Throwable {
+ service.clearIncomplete();
+ return null;
+ }
+ }.execute();
+
}
Util.setActiveServer(context, instance);
context.invalidate();
diff --git a/src/github/daneren2005/dsub/util/compat/RemoteControlClientJB.java b/src/github/daneren2005/dsub/util/compat/RemoteControlClientJB.java
index 5e1ad044..c27df2ba 100644
--- a/src/github/daneren2005/dsub/util/compat/RemoteControlClientJB.java
+++ b/src/github/daneren2005/dsub/util/compat/RemoteControlClientJB.java
@@ -12,6 +12,7 @@ import android.media.MediaMetadataRetriever;
import android.media.RemoteControlClient;
import github.daneren2005.dsub.activity.SubsonicActivity;
import github.daneren2005.dsub.service.DownloadService;
+import github.daneren2005.dsub.util.SilentBackgroundTask;
@TargetApi(18)
public class RemoteControlClientJB extends RemoteControlClientICS {
@@ -27,8 +28,14 @@ public class RemoteControlClientJB extends RemoteControlClientICS {
});
mRemoteControl.setPlaybackPositionUpdateListener(new RemoteControlClient.OnPlaybackPositionUpdateListener() {
@Override
- public void onPlaybackPositionUpdate(long newPosition) {
- downloadService.seekTo((int) newPosition);
+ public void onPlaybackPositionUpdate(final long newPosition) {
+ new SilentBackgroundTask<Void>(context) {
+ @Override
+ protected Void doInBackground() throws Throwable {
+ downloadService.seekTo((int) newPosition);
+ return null;
+ }
+ }.execute();
setPlaybackState(RemoteControlClient.PLAYSTATE_PLAYING);
}
});