Execution Problems AsynkTask

0

I'm doing a small system for a school job, where I basically record the coordinates to a server.

I have a LocationListener method, so that every 5 seconds I send my coordinates to the server, until there all right.

The problem is that 3 minutes after starting the app, it stops sending my data, I have made several tests and I realize that the Asynktask method is not executed and therefore does not allow me to send more data (But the coordinates if they are being generated)

This is the onLocationChanged event that sends coordinates every time.

  @Override
    public void onLocationChanged(Location location) {


        enviarCoordenadasBLL.recibirCoordenadas(location);
   }

As you can see it is sent to the BLL layer, later to the DAL layer, where I run my AsynkTask

public void CoordenadasParaEnviar(Location location){

    EnviarDatosAsynk datos= new EnviarDatosAsynk ();

    datos.execute(lat,lon);

}

Later I run my AsynkTask and send the data, but as I mentioned before, it runs a couple of times and then stops entering my AsynkTask, within my perception I feel that the error may be in the number of times I perform the instances (new) because it would be to create instances every 5 seconds.

If you have any suggestions, it would be very helpful, since I have no idea what could be the problem.

    
asked by AndreyC1995 19.04.2018 в 21:57
source

0 answers