Ejemplo n.º 1
0
 @Override
 public void onServiceConnected(ComponentName name, IBinder service) {
   // TODO Auto-generated method stub
   mSocketService = (ILCSocketService) (((BinderServicePolice) service).getService());
   mSocketService.addSocketServiceConnectListen(LCActionbarActivity.this);
   mSocketService.addReceiveDataListen(LCActionbarActivity.this);
   mSocketService.addOnSocketSendDataSuccessListen(LCActionbarActivity.this);
   mSocketService.ConnectByAuto();
 }
Ejemplo n.º 2
0
 protected void destroyService() {
   if (mSocketService != null) {
     mSocketService.removeSocketServiceConnectListen(this);
     mSocketService.removeReceiveDataListen(this);
   }
   if (isBind) {
     getApplicationContext().unbindService(mServiceConnection);
     isBind = false;
   }
 }