Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

242
Visualizações
AlarmManager.setAlarmClock() not showing alarm in top right corner on Android Pie

I am having an alarm app that sets alarm using following code for devices on Marshmallow and higher:

val alarmIntent: PendingIntent = Intent(context, AlarmReceiver::class.java).let { intent ->
    intent.putExtra(Const.EXTRA_ALARM_ID, alarm.alarmId)
    PendingIntent.getBroadcast(context, 
                               alarm.calculateBroadcastId(dayOfWeek),
                               intent, 
                               PendingIntent.FLAG_UPDATE_CURRENT)
}

alarmManager.setAlarmClock(
            AlarmManager.AlarmClockInfo(calendar.timeInMillis, alarmIntent),
            preAlarmIntent)

It works as expected and shows alarm icon in top right corner (see attachment) on all devices except those devices running Android Pie.

UPDATE: Not on all devices running Android Pie, just Samsung (S8) so far.

Is there any additional code that I should add into the pending intent or somewhere in order to show this icon?

Photo of the device running Android Oreo (OS 8.1) and showing alarm icon as expected: enter image description here

over 4 years ago · Santiago Trujillo
1 Respostas
Responde à pergunta

0

In android Pie restrictions are introduced on the apps running in background.
This is due to new features introduced to improve device power management.

These features are explained in android developer documents in detail.
You can check details in this Link.
Hope it helps you !

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda