Anonymous
Anonymous

Reputation: 4910

Can setForeground() be used by multiple services with same notification?

I know that startForeground(notification_ID, notification) makes the service stronger in terms of not being destroyed by the system. But can the same notification be used to keep 2 or 3 services alive or is this privilege passed to the service that called it last?

Upvotes: 2

Views: 891

Answers (1)

Alexandr Kotikov
Alexandr Kotikov

Reputation: 426

use same notification ID. Only one notification with specific ID can exist. Or bind service and let main one run on foreground, https://developer.android.com/guide/components/bound-services.html

Upvotes: 1

Related Questions