Fixed crashes on pre-Marshmallow devices because of Notification
This commit is contained in:
parent
3f5d83b4d4
commit
eb02b7eb1d
2 changed files with 3 additions and 4 deletions
|
@ -431,9 +431,7 @@ public class MusicService extends MediaBrowserServiceCompat
|
|||
registerReceiver(lockScreenReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
|
||||
|
||||
setSessionToken(mediaSession.getSessionToken());
|
||||
if (VersionUtils.INSTANCE.hasMarshmallow()) {
|
||||
notificationManager = getSystemService(NotificationManager.class);
|
||||
}
|
||||
notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||
initNotification();
|
||||
|
||||
mediaStoreObserver = new MediaStoreObserver(this, playerHandler);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue