Gerardo
Gerardo

Reputation: 5830

Android: Get an instance from a service running

I have a service running in background. I started it from an Activity, but I want to recover an instance of that service from another activity (in the same app) in order to call one method. Is it possible?

Upvotes: 5

Views: 5342

Answers (1)

CommonsWare
CommonsWare

Reputation: 1007624

There is only one instance of the service, at most. You cannot have two instances. Hence, just have the second activity bind to the service ("recovery an instance").

Upvotes: 1

Related Questions