Code example for ContextWrapper

Methods: unbindService

0
      ServiceBinder sb = sConnectionMap.remove(cw);
      if (sb == null) {
          Log.e("MusicUtils", "Trying to unbind for unknown Context");
          return; 
      } 
      cw.unbindService(sb);
      if (sConnectionMap.isEmpty()) {
          // presumably there is nobody interested in the service at this point, 
          // so don't hang on to the ServiceConnection 
          sService = null;
      } 
  } 
 
  private static class ServiceBinder implements ServiceConnection {
      ServiceConnection mCallback;
      ServiceBinder(ServiceConnection callback) {
          mCallback = callback;
      } 
       
      public void onServiceConnected(ComponentName className, android.os.IBinder service) {
          sService = IMediaPlaybackService.Stub.asInterface(service);