Code example for ContextWrapper

Methods: unbindService

0
        ServiceBinder sb = sConnectionMap.remove(cw);
        if (sb == null) {
        	logMsg("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 = IDemoService.Stub.asInterface(service);