title: Android Service: onBind(Intent) and onUnbind(Intent) is called just once
body: <p>I have the Activity and the Service. When Activity is started, it calls <code>startService()</code> to make this Service be alive even when Activity is destroyed, and <code>bindService()</code>, to communicate with this Service.</p>
  
  <p><code>bindService()</code> returns true, <code>mService.onBind()</code> is called, and <code>ServiceConnection.onServiceConnected()</code> is called too. All works. </p>
  
  <p>When i destroy my Activity by pressing Back key, it calls <code>unbindService()</code>, and my <code>mService.onUnbind()</code> is called. (i return <code>false</code> in this <code>onUnbind()</code>.) </p>
  
  <p>Then i start this Activity again, <code>bindService()</code> returns true, and then <code>mService.onBind()</code> is <strong>NOT</strong> called! But <code>ServiceConnection.onServiceConnected()</code> is called too, and all works again.</p>
  
  <p>It looks like Dalvik remembers what my <code>onBind()</code> returned last time, and just does not call <code>onBind()</code> again. When i destroy my Activity again, <code>onUnbind()</code> is <strong>NOT</strong> called too. </p>
  
  <p>I can bind and unbind this Service to my Activity any number of times, but these methods will not be called anymore until I destroy Service by unbinding and calling <code>stopService()</code>.</p>
  
  <p>In docs i can't find any explanation of this behavior. Conversely, <a href="http://developer.android.com/images/fundamentals/service_binding_tree_lifecycle.png">this figure</a> shows that <code>onBind()</code> and <code>onUnbind()</code> should be called every time clients bind and unbind Service. This figure can be found on the bottom of <a href="http://developer.android.com/guide/components/bound-services.html">this Dev Guide</a>.</p>