Reputation: 1165
If I create an android service using startService()
followed by bindService()
, and I never call stopService()
.
Now, every time my app calls startService()
and bindService()
, will it create a new instance of the service or reuse the existing one?
If a new instance is created...is the old instance still running or is it terminated?
Upvotes: 0
Views: 1856
Reputation: 6857
will it create a new instance
No. If you're calling startService()
even if service already running, it will call onStartCommand()
with updated Intent
Ps, Service will run in only one process. So there is no such doubt to create another instance
Upvotes: 4
Reputation: 3282
It will not create another service, but redeliver your start Intent into onNewIntent() method
Upvotes: 0