Fixed crash when moving progressbar
This commit is contained in:
parent
fab2110715
commit
58ec618276
|
@ -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,9 +407,11 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements
|
|||
|
||||
@Override
|
||||
public void onStopTrackingTouch(SeekBar seekBar) {
|
||||
if (PlaybackService.isRunning) {
|
||||
playbackService.seek((int) (prog * duration));
|
||||
setupPositionObserver();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// BUTTON SETUP
|
||||
|
|
Loading…
Reference in New Issue