Кто-нибудь знает, какой тип мне следует использовать. Код запуска сервиса следующий:
Код: Выделить всё
Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID)
.setContentTitle(exerciseNameStr + " Timer Running")
.setSmallIcon(exerciseIcons.getResourceId(iconId, 0))
.setContentIntent(pendingIntent)
.setChronometerCountDown(!countUpwards)
.setUsesChronometer(true)
.setTimeoutAfter(counterMsec + 1000)
.setWhen(time)
.build();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
{
startForeground(100, notification, FOREGROUND_SERVICE_TYPE_???);
}
else
{
startForeground(100, notification); //
Подробнее здесь: [url]https://stackoverflow.com/questions/77630944/foreground-service-type-for-timer[/url]