Fixed possible crash if activity wasn't connected to the service

This commit is contained in:
daniel oeh 2012-07-07 12:08:44 +02:00
parent 238f415315
commit 0c02286f83
1 changed files with 5 additions and 1 deletions

View File

@ -547,7 +547,11 @@ public class MediaplayerActivity extends SherlockFragmentActivity implements
}
break;
case PlaybackService.NOTIFICATION_TYPE_RELOAD:
unbindService(mConnection);
try {
unbindService(mConnection);
} catch (IllegalArgumentException e) {
e.printStackTrace();
}
if (positionObserver != null) {
positionObserver.cancel(true);
positionObserver = null;