In the cargarTodosEquipos()
method the onResponse
is telling you that it is over, then before your toast "EQUIPOS CARGADOS SATISFACTORIAMENTE"
, it will be there to load the spinner
So, get this line from onCreate();
spinner.setItems(db.equipoDao().equipos());
and put it on top of that Toast in the onResponse
spinner.setItems(db.equipoDao().equipos());
What happens is that the onCreate () when executed, executes everything in a single pass, and while the data base is loading, I already execute the spinner code to fill it with data when it does not have, then moving the setting of the spinner to when the database ends loading the data is what should load all the data once finished.