user2978042
user2978042

Reputation: 221

Running multiple instance of a service

Is it possible to start a service multiple times. Means calling startService multiple times. I know if I call startService , it'll call onCreate() -> onStartCommand(). on startService, it calls only onStartCommand() without onCreate(). What happens to the service ? Is it creating multiple instance of the service ?

Upvotes: 1

Views: 2607

Answers (1)

Rashad
Rashad

Reputation: 11197

No, the Service will only run in one instance. However, every time you start the service, the onStartCommand() method is called. Look at this documentation.

Upvotes: 7

Related Questions