Hello, maybe you can help me with this behavior.
I have in main screen a CustomListView with multiple ImageSliders with a lot of images, and I download images with ImageSlider1_GetImage.
In some devices take a long time to get images, and the user navigate in other menus, and when the image is complete downloaded the main screen appear againg and new activity user open was closed, there are some way to avoid this behavior maybe blocking with progress dialog, but I dont know when the all images are downloaded.
Sometimes happend other times not.
Thanks for your help.
Thanks,
Christian
I have in main screen a CustomListView with multiple ImageSliders with a lot of images, and I download images with ImageSlider1_GetImage.
In some devices take a long time to get images, and the user navigate in other menus, and when the image is complete downloaded the main screen appear againg and new activity user open was closed, there are some way to avoid this behavior maybe blocking with progress dialog, but I dont know when the all images are downloaded.
Sometimes happend other times not.
Thanks for your help.
B4X:
Sub imgSlider_GetImage (Index As Int) As ResumableSub
Dim slider As ImageSlider = Sender
Dim IndexInList As Int = slider.Tag
Dim si As SliderAndImages = clvcards.GetValue(IndexInList)
Dim image_link As String
' Log("imgSlider_GetImage " & Index & " " & IndexInList)
ProgressDialogShow2("Procesando imágenes...",False)
image_link = GetFileName(si.Images.Get(Index))
Dim x As B4XBitmap
If File.Exists(File.DirInternal,image_link) Then
x = xui.LoadBitmapResize(File.DirInternal,image_link,imgSlider.WindowBase.Width, imgSlider.WindowBase.Height, True)
Else
Dim j As HttpJob
j.Initialize("", Me)
j.Download(si.Images.Get(Index))
Log("Downloading: " & si.Images.Get(Index))
Wait For (j) JobDone(j As HttpJob)
If j.Success Then
If Globals.ImageToDisk = True Then
SaveImagetoDisk(j,image_link)
End If
x = j.GetBitmap
x = x.Resize(imgSlider.WindowBase.Width, imgSlider.WindowBase.Height, True)
Else
x = xui.LoadBitmapResize(File.DirAssets, "500px-No_image_available.svg.png", _
imgSlider.WindowBase.Width, imgSlider.WindowBase.Height, True)
End If
j.Release
End If
ProgressDialogHide
' si.Slider.label1.Top = 90%y
' si.Slider.label2.Top = 90%y
Return FillImageToView(x,imgSlider)
End Sub
Thanks,
Christian