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));
|
registerReceiver(lockScreenReceiver, new IntentFilter(Intent.ACTION_SCREEN_OFF));
|
||||||
|
|
||||||
setSessionToken(mediaSession.getSessionToken());
|
setSessionToken(mediaSession.getSessionToken());
|
||||||
if (VersionUtils.INSTANCE.hasMarshmallow()) {
|
notificationManager = (NotificationManager) getSystemService(NOTIFICATION_SERVICE);
|
||||||
notificationManager = getSystemService(NotificationManager.class);
|
|
||||||
}
|
|
||||||
initNotification();
|
initNotification();
|
||||||
|
|
||||||
mediaStoreObserver = new MediaStoreObserver(this, playerHandler);
|
mediaStoreObserver = new MediaStoreObserver(this, playerHandler);
|
||||||
|
|
|
@ -5,7 +5,8 @@
|
||||||
android:layout_width="match_parent"
|
android:layout_width="match_parent"
|
||||||
android:layout_height="match_parent"
|
android:layout_height="match_parent"
|
||||||
android:clickable="true"
|
android:clickable="true"
|
||||||
android:focusable="true">
|
android:focusable="true"
|
||||||
|
android:background="?attr/colorSurface">
|
||||||
|
|
||||||
<View
|
<View
|
||||||
android:id="@+id/colorGradientBackground"
|
android:id="@+id/colorGradientBackground"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue