Skip to content

Commit

Permalink
Merge pull request Baseflow#895 from BajakiGabesz/894-crash_at_startup
Browse files Browse the repository at this point in the history
Update MediaBrowserService.cs
  • Loading branch information
martijn00 authored Mar 16, 2023
2 parents 7f72e5b + 14e6036 commit de3cc72
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,14 @@ protected virtual void PrepareNotificationManager()
if (ongoing && !IsForeground)
{
ContextCompat.StartForegroundService(ApplicationContext, new Intent(ApplicationContext, MediaBrowserManager.ServiceType));
StartForeground(notificationId, notification, ForegroundService.TypeMediaPlayback);
if (Build.VERSION.SdkInt >= BuildVersionCodes.S)
{
StartForeground(notificationId, notification, ForegroundService.TypeMediaPlayback);
}
else
{
StartForeground(notificationId, notification);
}
IsForeground = true;
}
}
Expand Down

0 comments on commit de3cc72

Please sign in to comment.