Update manifest, startForeground call
This commit is contained in:
parent
59db955493
commit
b9b47fc520
2 changed files with 11 additions and 8 deletions
|
|
@ -174,12 +174,8 @@ public final class NotificationUtil {
|
|||
}
|
||||
updateNotification();
|
||||
|
||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||
player.getService().startForeground(NOTIFICATION_ID, notificationBuilder.build(),
|
||||
ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK);
|
||||
} else {
|
||||
player.getService().startForeground(NOTIFICATION_ID, notificationBuilder.build());
|
||||
}
|
||||
ServiceCompat.startForeground(player.getService(), NOTIFICATION_ID,
|
||||
notificationBuilder.build(), ServiceInfo.FOREGROUND_SERVICE_TYPE_MEDIA_PLAYBACK);
|
||||
}
|
||||
|
||||
public void cancelNotificationAndStopForeground() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue