Fixed crashes on pre-Marshmallow devices because of Notification

This commit is contained in:
Prathamesh More 2022-01-02 11:35:57 +05:30
parent 3f5d83b4d4
commit eb02b7eb1d
2 changed files with 3 additions and 4 deletions

View file

@ -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);

View file

@ -5,7 +5,8 @@
android:layout_width="match_parent"
android:layout_height="match_parent"
android:clickable="true"
android:focusable="true">
android:focusable="true"
android:background="?attr/colorSurface">
<View
android:id="@+id/colorGradientBackground"