Пример #1
0
  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
    log.putLog("CS Starting...");
    if (isRunning()) {
      log.putLog("Already running");
      stopSelf();
      return START_NOT_STICKY;
    }
    setRunning(true);
    // startDebugThread();

    videoService = new VideoService(this);
    usbService = new UsbService(this);
    lightService = new LightService(this);
    orientationService = new OrientationService(this);
    locationService = new LocationService(this);
    updateService = new UpdateService(this);
    bindService(networkServiceIntent, networkServiceConnection, Context.BIND_AUTO_CREATE);

    usbService.start();
    updateService.start();

    return super.onStartCommand(intent, flags, startId);
  }
Пример #2
0
 public void restartUsbService() {
   if (usbService != null) {
     usbService.stop();
     usbService.start();
   }
 }