Beispiel #1
0
 public override void OnReceive(Context context, Intent intent)
 {
     if (intent.Action == Intent.ActionBootCompleted)
     {
         Intent pushIntent = new Intent(context, typeof(GPSAndroid));
         context.StartService(pushIntent);
         InvokeAbortBroadcast();
     }
     else if (intent.Action == PercursoBLL.ACAO_PARAR_SIMULACAO)
     {
         GPSUtils.pararSimulacao();
         MensagemUtils.pararNotificaoPermanente(PercursoBLL.NOTIFICACAO_SIMULACAO_PERCURSO_ID);
         InvokeAbortBroadcast();
     }
     else if (intent.Action == PercursoBLL.ACAO_PARAR_GRAVACAO)
     {
         PercursoBLL regraPercurso = PercursoFactory.create();
         regraPercurso.pararGravacao();
         //MensagemUtils.pararNotificaoPermanente(PercursoBLL.NOTIFICACAO_GRAVAR_PERCURSO_ID);
         InvokeAbortBroadcast();
     }
     else if (intent.Action == "Fechar")
     {
         NotificationManager notificationManager = (NotificationManager)context.GetSystemService(Context.NotificationService);
         notificationManager.Cancel(1);
         System.Environment.Exit(0);
         Process.KillProcess(Process.MyPid());
     }
 }
Beispiel #2
0
        public bool pararGravacao()
        {
            if (!PercursoUtils.Gravando)
            {
                return(false);
            }
            var percurso = PercursoUtils.PercursoAtual;

            PercursoUtils.PercursoAtual = null;
            PercursoUtils.Gravando      = false;
            MensagemUtils.avisar("Gravação finalizada!");
            MensagemUtils.pararNotificaoPermanente(PercursoBLL.NOTIFICACAO_GRAVAR_PERCURSO_ID);
            atualizarEndereco(percurso);
            return(true);
        }
Beispiel #3
0
        public bool pararGravacao()
        {
            if (!PercursoUtils.Gravando)
            {
                return(false);
            }
            //MensagemUtils.notificar(2, "Gravando Percurso", "Gravando percurso agora!");
            var percurso = PercursoUtils.PercursoAtual;

            PercursoUtils.PercursoAtual = null;
            //_dataAnterior = DateTime.MinValue;
            //_ultimoMovimentoReal = DateTime.MinValue;
            PercursoUtils.Gravando = false;
            //_emMovimento = false;
            MensagemUtils.avisar("Gravação finalizada!");
            MensagemUtils.pararNotificaoPermanente(PercursoBLL.NOTIFICACAO_GRAVAR_PERCURSO_ID);
            atualizarEndereco(percurso);
            return(true);
        }