コード例 #1
0
 private void StopHandlerThread()
 {
     _handler?.RemoveCallbacks(ScheduleNext);
     _handlerThread?.Quit();
     _handlerThread?.Interrupt();
     _handlerThread = null;
 }
コード例 #2
0
 public void stop()
 {
     if (camera != null)
     {
         camera.StopPreview();
         camera.SetPreviewCallback(null);
         camera.Release();
         camera = null;
     }
     if (cameraHandlerThread != null)
     {
         cameraHandlerThread.Quit();
         cameraHandlerThread = null;
     }
     LogUtil.i("wtf", "stop");
 }
コード例 #3
0
        private void StartRequestingLocationUpdates()
        {
            _locationManager.RemoveUpdates(this);
            if (_handlerThread != null) //ensure there is only one thread running
            {
                _handlerThread.Quit();
                _handlerThread = null;
            }

            Log.Info(Tag, $"Request location updates start");
            _logService.WriteToLog(LogFilename, $"Request location updates start");

            try
            {
                _locationManager.RequestLocationUpdates(LocationManager.GpsProvider,
                                                        FiveSeconds, 1, this);
            }
            catch (Exception ex)
            {
                _logService.WriteToLog("Exceptions", $"({LogFilename}) {ex.Message}");
            }
        }
 public void StopPeriodic()
 {
     _handlerThread.Quit();
     _handlerThread.Interrupt();
     _handlerThread.Dispose();
 }