You can use a BroadCastReceiver
declared in your manifest and a launch a PendingIntent
for the time you want the notification to launch. Then it's a matter of creating said notification on the onReceive
method of the BroadCastReceiver
.
timed notification without using service
-
17-06-2023 - |
Pergunta
I know there any many questions like my question , I've read many of them, and now I'm really confused that is it really possible to show a notification when the activity has been destroyed and our app is not in memory. here is the scenario: My app is in the memory and the user select a time in the future then the app must show a notification and then he/she will close the app.I really want to do it without writing a service. Is it possible? how?
I have tested using alarm manager but when user completely close the app , the timed notifications doesn't work.And the timed notifications can be more than one.
Solução
Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow