Using Activtiy lifecycle methods, what's the best strategy for binding and unbinding to a local service?
<p>I'm binding to a local <code>Service</code> (that is, not using IPC and AIDL) from several activities. I want to ensure that I'm not holding references to this service from activities that the user isn't using.</p>

<p>My options are: 1.) to bind to the service in <code>onCreate()</code> and unbind in <code>onDestroy()</code>.
2.) bind in <code>onStart()</code> and unbind in <code>onStop()</code>.
3.) bind in <code>onResume()</code> and unbind in <code>`onPause()</code>. Or some combination of these.</p>

<p>Which is the best-practice way of binding and unbinding to a local service? Do I not need to be concerned with holding local connections from stopped activities?</p>

<p>Additionally, once bound to this particular service I am retrieving a <code>Cursor</code> which is attached to my <code>ListActivity</code> via a <code>CursorAdapter</code>. The data retrieved by the Cursor may have changed while the Activity was out of view so I want to requery it when the Activity is shown again. If I bind in <code>onCreate()</code> I can requery in <code>onRestart()</code>. If I bind in <code>onResume()</code> each time the data will be fresh because I'll query it in the Service's connected callback.</p>

<p>Thoughts, comments, critiques or suggestions?</p>
