diff options
author | daniel oeh <daniel.oeh@gmail.com> | 2014-02-10 19:05:33 +0100 |
---|---|---|
committer | daniel oeh <daniel.oeh@gmail.com> | 2014-02-10 19:05:33 +0100 |
commit | 69f424e71c75df8b3e459d0de99268dddab35fcf (patch) | |
tree | df35d658c55f940ebc6a9f96a8040b1c733d781a /src | |
parent | aba5568176b2c18d07bab2b60b9c1b4e558278d3 (diff) | |
download | AntennaPod-69f424e71c75df8b3e459d0de99268dddab35fcf.zip |
Improved error handling in MediaPlayerActivity
Diffstat (limited to 'src')
-rw-r--r-- | src/de/danoeh/antennapod/util/playback/PlaybackController.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/de/danoeh/antennapod/util/playback/PlaybackController.java b/src/de/danoeh/antennapod/util/playback/PlaybackController.java index 74de81217..f50c99ab1 100644 --- a/src/de/danoeh/antennapod/util/playback/PlaybackController.java +++ b/src/de/danoeh/antennapod/util/playback/PlaybackController.java @@ -3,6 +3,7 @@ package de.danoeh.antennapod.util.playback; import android.app.Activity; import android.content.*; import android.content.res.TypedArray; +import android.media.MediaPlayer; import android.os.AsyncTask; import android.os.IBinder; import android.preference.PreferenceManager; @@ -415,6 +416,7 @@ public abstract class PlaybackController { case ERROR: postStatusMsg(R.string.player_error_msg); + handleError(MediaPlayer.MEDIA_ERROR_UNKNOWN); break; case PAUSED: clearStatusMsg(); @@ -520,7 +522,7 @@ public abstract class PlaybackController { */ public float onSeekBarProgressChanged(SeekBar seekBar, int progress, boolean fromUser, TextView txtvPosition) { - if (fromUser && playbackService != null) { + if (fromUser && playbackService != null && media != null) { float prog = progress / ((float) seekBar.getMax()); int duration = media.getDuration(); txtvPosition.setText(Converter |