Hello,
While I load the items from a database (SQLite stored in the Sandbox) I try to use a spinner to indicate the user to wait for a moment.
Ok, I suppose this is the spinner is used for, but while the items are loaded, the spinner is stopped.
Seems the processor is busy and till the items are loaded the spinner can’t be working, but then I just don’t need the spinner, so, What is it for a spinner!?
Here you can see what I talking about:
[sharedmedia=core:attachments:135]
And here is the code called when I select an option:
local function filtraEstablecementos() local num\_estrelas = filtros[10] local i,j,l local ids\_tras\_filtro = {} local subcadena\_consulta = "" local nivel\_zona\_actual\_aux2 local function filtra() if not ultimo\_nivel then nivel\_zona\_actual\_aux2 = nivel\_zona\_actual else nivel\_zona\_actual\_aux2 = nivel\_zona\_actual\_aux end local function completaCadena() local cadena = "" local k if num\_estrelas \> 0 then cadena = cadena.." AND categoria="..num\_estrelas end for k=1,#filtros-1 do if filtros[k] == 1 then local ind = correspondencia\_filtros[k] cadena = cadena.." AND id IN (SELECT idHotel from iconosHotel WHERE idIcono="..ind..")" end end if entrada\_buscador ~= "" then cadena = cadena.." AND nombre LIKE '%"..entrada\_buscador.."%'" end return cadena end for i = 1,#array\_zonas do if (nivel\_zona\_actual\_aux2 == array\_zonas[i].id) then --and (#pila\_niveis \> 0) then local array\_id\_establecementos if que\_vexo == "hoteis" then array\_id\_establecementos = array\_zonas[i].id\_hoteis elseif que\_vexo == "apartamentos" then array\_id\_establecementos = array\_zonas[i].id\_apartamentos end subcadena\_consulta = completaCadena() for j=1,#array\_id\_establecementos do for fileira in db:nrows("SELECT id FROM hoteles WHERE id="..array\_id\_establecementos[j]..subcadena\_consulta) do table.insert(ids\_tras\_filtro,fileira.id) end end end end montaScrollDereita(ids\_tras\_filtro) end cargando:start() cargando.isVisible = true aviso\_non\_resultados.isVisible = false local tmr = timer.performWithDelay(400,filtra) end