Question

So I want to start a notification only when x Activity onStop() is called. But I want to have a loop that updates the notification every second (countdown)

As you can imagine, I want to cancel the notification on the Activity onResume() or on the autocancel for the notification.

As a general Android question, is the only way to do this is with a Service? Open to any and all suggestions.

Was it helpful?

Solution

Yes, Wes. Since the Activity itself is in onStop(), you need something outside the Activity to do a continuing action (the countdown). A Service is the usual way to accomplish that.

Peter

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top