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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top