title: Custom adapter using bound service - when to unbind?
body: <p>The setup: custom adapter that feeds data into <code>ListView</code>. Data is based on some numbers calculated by external service. I am using AIDL to bind the service and get the data I need.</p>
  
  <p>Problem: How do I know when to unbind the service? Connection is private to adapter itself and the only way to detect that whole application is shutting down is overriding <code>unregisterDataSetObserver</code>. Or at least I didn't find another way and this one worked well with same adapter using content provider+content observer. Does not work with AIDL though - I'm getting the <code>ServiceConnectionLeaked</code> error.</p>
  
  <p>I know I can add a "unbindFromService" method to my adapter and call it from onDestroy() of my activity but that isn't elegant enough for me. I'd prefer some "honest" trigger if possible.</p>