From 58ec6182764951058b9caf261f63ce3432c0b98f Mon Sep 17 00:00:00 2001 From: daniel oeh Date: Thu, 26 Jul 2012 20:22:10 +0200 Subject: [PATCH] Fixed crash when moving progressbar --- .../danoeh/antennapod/activity/MediaplayerActivity.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java index 309f658a2..272cd8b02 100644 --- a/src/de/danoeh/antennapod/activity/MediaplayerActivity.java +++ b/src/de/danoeh/antennapod/activity/MediaplayerActivity.java @@ -387,7 +387,7 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements @Override public void onProgressChanged(SeekBar seekBar, int progress, boolean fromUser) { - if (fromUser) { + if (fromUser && PlaybackService.isRunning) { prog = progress / ((float) seekBar.getMax()); duration = playbackService.getPlayer().getDuration(); txtvPosition.setText(Converter @@ -407,8 +407,10 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements @Override public void onStopTrackingTouch(SeekBar seekBar) { - playbackService.seek((int) (prog * duration)); - setupPositionObserver(); + if (PlaybackService.isRunning) { + playbackService.seek((int) (prog * duration)); + setupPositionObserver(); + } } });