Hi, I have the following problem. My code downloads images from my jRDC server. Before the download starts, it shows the ProgressDialog by the line hd.ProgressDialogShow("Loading")
after it downloads, it hides it by: hd.ProgressDialogHide. The problem is that it often hides the progress dialog before the download finishes. And also, if I remove the hd.ProgressDialogHide line, the ProgressDialog Hides even though no command to hide it was executed. The code I use:
Any ideas how to solve this issue? Thanks
after it downloads, it hides it by: hd.ProgressDialogHide. The problem is that it often hides the progress dialog before the download finishes. And also, if I remove the hd.ProgressDialogHide line, the ProgressDialog Hides even though no command to hide it was executed. The code I use:
B4X:
Wait For (LoadBankSkins(BanksIDList.Get(BanksList.IndexOf(Item)))) Complete (Resultt As Int)
Sub LoadBankSkins (BankID As String) As ResumableSub
Dim req As DBRequestManager = CreateRequest
Dim comand As DBCommand = CreateCommand("getIDCARDSBankSkins", Array(BankID))
hd.ProgressDialogShow("Loading")
Wait For (req.ExecuteQuery(comand, 0, Null)) JobDone(j As HttpJob)
If j.Success Then
req.HandleJobAsync(j, "req")
Sleep(0)
Wait For (req) req_Result(res As DBResult)
Sleep(0)
BankCardTextColor.Initialize
BankCardTopLightTheme.Initialize
BankCardLightTheme.Initialize
BankCardSkin.Initialize
BankCardSkinId.Initialize
BankCardBitmap=Null
BankCardSkin.Tag=0
For Each row() As Object In res.Rows
CardNumberLb.Tag=Colors.RGB(row(res.Columns.Get("text_color_red")),row(res.Columns.Get("text_color_green")),row(res.Columns.Get("text_color_blue")))
BankCardTextColor.Add(CardNumberLb.Tag)
BankCardTopLightTheme.Add((row(res.Columns.Get("top_light_theme"))))
BankCardLightTheme.Add((row(res.Columns.Get("light_theme"))))
BankCardSkinId.Add((row(res.Columns.Get("skin_id"))))
Sleep(0)
Dim buffer() As Byte
Sleep(0)
buffer = row(res.Columns.Get("skin_image"))
Sleep(0)
BankCardBitmap=req.BytesToImage(buffer)
Sleep(0)
BankCardSkin.Add(BankCardBitmap)
Next
Sleep(0)
If BankCardSkinId.Size>0 Then
CreditCardBankSkinLb.Text=Dictionary1.Get("SKIN",Main.Language)&" "&(BankCardSkin.Tag+1)&"/"&BankCardSkinId.Size
CreditCardBankSkinLb.Visible=True
CreditCardBankSkinNextBtn.Visible=True
CreditCardBankSkinPrevBtn.Visible=True
Else
CreditCardBankSkinLb.Visible=False
CreditCardBankSkinNextBtn.Visible=False
CreditCardBankSkinPrevBtn.Visible=False
End If
Sleep(0)
j.Release
Log("Skins Download finished")
Sleep(0)
hd.ProgressDialogHide
'If I remove ProgressDialogHide, the ProgessDialog will hide anyway. Yet when executing another download, hd.ProgressDialogShow will do nothing
Sleep(0)
Return 1
Else
j.Release
Return -1
End If
End Sub
Any ideas how to solve this issue? Thanks