iOS Question ProgressDialogShow only flash..

Marco Maria Vilucchi

Active Member
Licensed User
Longtime User
Hi,
I'm using iHud library
When I use ProgressDialogShow, it only flash...
Example:

ProgressDialogShow
Read 200 records
ProgressDialogHide


It just flash at the end of read istruction

It seems I wrote:

Read 200 records
ProgressDialogShow
ProgressDialogHide

What appens?
Thx
Marco

I put Code...
B4X:
Sub StatsGlobali
    hd.ProgressDialogShow("Attendere...")

    If LastNum=9999 Then
        Table = DBUtils.ExecuteMemoryTable(SQL1, "SELECT * FROM scouting order by scid", Null, 0)
        statsmenuLBTitolo.Text=ML.StatsMenu_BT_Team
    Else
        Table = DBUtils.ExecuteMemoryTable(SQL1, "SELECT * FROM scouting where scnum=" & LastNum & " order by scid", Null, 0)
        statsmenuLBTitolo.Text=LastNom
    End If
    For sq = 0 To Table.Size - 1
        Cols = Table.Get(sq)
        LastId=Cols(0)
        LastNum=Cols(1)
        LastAzione=Cols(2)
        LastVoto=Cols(3)
'        Log("Id: " & LastId & " Num: " & LastNum & " Azione: " & LastAzione & " Voto: " & LastVoto)
        If LastAzione=1 Then
            If LastVoto=1 Then
                CntAz1Vt1=CntAz1Vt1+1
            Else If LastVoto=2 Then   
                CntAz1Vt2=CntAz1Vt2+1
            Else If LastVoto=3 Then   
                CntAz1Vt3=CntAz1Vt3+1
            Else If LastVoto=4 Then   
                CntAz1Vt4=CntAz1Vt4+1
            Else If LastVoto=5 Then   
                CntAz1Vt5=CntAz1Vt5+1
            End If
        Else If LastAzione=2 Then   
            If LastVoto=1 Then
                CntAz2Vt1=CntAz2Vt1+1
            Else If LastVoto=2 Then   
                CntAz2Vt2=CntAz2Vt2+1
            Else If LastVoto=3 Then   
                CntAz2Vt3=CntAz2Vt3+1
            Else If LastVoto=4 Then   
                CntAz2Vt4=CntAz2Vt4+1
            Else If LastVoto=5 Then   
                CntAz2Vt5=CntAz2Vt5+1
            End If
        Else If LastAzione=3 Then   
        End If

........

    Next
    TotAz1=CntAz1Vt1+CntAz1Vt2+CntAz1Vt3+CntAz1Vt4+CntAz1Vt5
    TotAz2=CntAz2Vt1+CntAz2Vt2+CntAz2Vt3+CntAz2Vt4+CntAz2Vt5
    TotAz3=CntAz3Vt1+CntAz3Vt2+CntAz3Vt3+CntAz3Vt4+CntAz3Vt5
    TotAz4=CntAz4Vt1+CntAz4Vt2+CntAz4Vt3+CntAz4Vt4+CntAz4Vt5
    TotAz5=CntAz5Vt1+CntAz5Vt2+CntAz5Vt3+CntAz5Vt4+CntAz5Vt5
    TotAz6=CntAz6Vt1+CntAz6Vt2+CntAz6Vt3+CntAz6Vt4+CntAz6Vt5
   
    If TotAz1=0 Then
        statsmenuLBPerc1.Text=NumberFormat(CntAz1Vt5,0,1) & "%"
    Else
        statsmenuLBPerc1.Text=NumberFormat((CntAz1Vt5 / TotAz1 * 100),0,1) & "%"
    End If
    statsmenuLBQta1.Text= "(" & CntAz1Vt5 & " su " & TotAz1 & ")"

.......

    hd.ProgressDialogHide
End Sub
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Make sure to test performance in release mode. There is a good change that this whole sub will be fast enough that the progress dialog will not be required at all.

If it is not fast enough then you need to show the progress dialog and then use CallSubDelayed to call another sub that will do all the work. You might need to split it into several calls.
 
Upvote 0
Top