android - wait to asynctask finish from another asynctask -


im is querying a DB with an asyntask that works in an object, and this object is a The problem is that I do not know the way to wait for query results before trying to use methods from this object. This taps point is the reason for exception. I tried with this time and it works, but I know it has not been done properly.

  // With this constructor I create an asyntask which db empresa = new Empresa (id_empresa); / * While (! Empresa.consulta_terminada) {// none of the advice on this question) * / Log.e ("EMPRESA NOMBRE", empresa.getNombre ()); Sita = new Sita (Itenario, Hora_Farmato, Empressia); Citas.add (cita);  

Sorry for my english and thanks!

Pass a runnab for AsyncTask, and open it on postExecute (). Or use handler and handler thanks to doing async tasks, this will be more flex.


Comments

Popular posts from this blog

import - Python ImportError: No module named wmi -

Editing Python Class in Shell and SQLAlchemy -

c# - MySQL Parameterized Select Query joining tables issue -