Initialize mNotificationManager where it is needed

This commit is contained in:
Christopher Eby 2010-03-03 15:23:23 -06:00
parent adf1ca18f2
commit b2c7609cc3

View File

@ -357,6 +357,8 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
boolean stateLoaded = mSongTimeline != null;
mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
if (!stateLoaded) {
retrieveSongs();
mSongTimeline = new ArrayList<Song>();
@ -374,7 +376,6 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
mMediaPlayer.setOnErrorListener(this);
mAudioManager = (AudioManager)getSystemService(Context.AUDIO_SERVICE);
mNotificationManager = (NotificationManager)getSystemService(NOTIFICATION_SERVICE);
try {
mStartForeground = getClass().getMethod("startForeground", int.class, Notification.class);