ackio
ackio

Reputation: 662

onBind/onRebind doesn't called in Service

I'm stuck with the following situation. I have a service in my app. The activity started it with startService() to prevent it from closing on unbind in the future. Than binds to the service with bindService() and unbinds later with unbindService(). All that works fine and as expected: onBind/onUnbind is called and service remains running. But when i call bindService() again from this or another activity i've got another behavior: neither onBind nor onRebind are called, but onServiceConnected() still called and i get IBinder implementation that's returned in onBind(). Any ideas? Thx in advance!

Upvotes: 4

Views: 3965

Answers (1)

Tobias
Tobias

Reputation: 883

onRebind() This will only be called if the implementation of onUnbind(Intent) was overridden to return true.

Is this done?

Upvotes: 20

Related Questions