Fix crash with no songs on device
This commit is contained in:
parent
9530cffaa6
commit
21d5fafa74
@ -468,13 +468,13 @@ public class PlaybackService extends Service implements Runnable, MediaPlayer.On
|
|||||||
|
|
||||||
private void updateNotification()
|
private void updateNotification()
|
||||||
{
|
{
|
||||||
if (!mNotifyWhilePaused && mState == STATE_NORMAL) {
|
Song song = getSong(0);
|
||||||
|
|
||||||
|
if (song == null || !mNotifyWhilePaused && mState == STATE_NORMAL) {
|
||||||
mNotificationManager.cancel(NOTIFICATION_ID);
|
mNotificationManager.cancel(NOTIFICATION_ID);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
Song song = getSong(0);
|
|
||||||
|
|
||||||
String title = song.title;
|
String title = song.title;
|
||||||
if (mState != STATE_PLAYING)
|
if (mState != STATE_PLAYING)
|
||||||
title += ' ' + getResources().getString(R.string.paused);
|
title += ' ' + getResources().getString(R.string.paused);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user