Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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!

like image 989
ackio Avatar asked Dec 02 '22 04:12

ackio


1 Answers

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

Is this done?

like image 155
Tobias Avatar answered Dec 05 '22 08:12

Tobias