Android Question imagedownloader Downsampling image due to lack of memory

Douglas Farias

Expert
Licensed User
Longtime User
hi i m using this imagedownloader to download images to my views
later i finish use this i close the sub using

http://www.b4x.com/android/forum/threads/imagedownloader-the-simple-way-to-download-images.30875/

B4X:
    CallSub(ImageDownloader, "ClearCache")
    CallSub(ImageDownloader, "ActivityIsPaused")
    Activity.RemoveAllViews
    Activity.Finish

but when i open this activity later 3 4 times show me
Downsampling image due to lack of memory

but why ? i remove all views i m clear the cache when i close the activity where is the problem ¬¬ ?


 

Douglas Farias

Expert
Licensed User
Longtime User
for try fix this problem *-*

i try only
Activity.RemoveAllViews
Activity.Finish

and give me the same problem *-*

i m loading images with this code


B4X:
Sub verificaimagem
Private links As Map
links.Initialize


    If kv.GetSimple("imgcrop") = "3" Then
    CallSub(ImageDownloader, "ClearCache")
    links.Put(ImageView1, "http://lala/clickfight/UsersImages/"&userid&"/MeuPerfil/FinalPictures/"&"3.jpg")
    links.Put(imageviewbackground, "http://lala/clickfight/UsersImages/"&userid&"/MeuPerfil/NaoEnviadas/FinalPictures/"&"3.jpg")
    CallSubDelayed2(ImageDownloader, "Download", links)

    Else If kv.GetSimple("imgcrop") = "2" Then
    CallSub(ImageDownloader, "ClearCache")
    links.Put(ImageView1, "http://lala/clickfight/UsersImages/"&userid&"/MeuPerfil/FinalPictures/"&"2.jpg")
    links.Put(imageviewbackground, "http://lala/clickfight/UsersImages/"&userid&"/MeuPerfil/NaoEnviadas/FinalPictures/"&"2.jpg")
    CallSubDelayed2(ImageDownloader, "Download", links)

    Else If kv.GetSimple("imgcrop") = "1" Then
    CallSub(ImageDownloader, "ClearCache")
    links.Put(ImageView1, "http://lala/clickfight/UsersImages/"&userid&"/MeuPerfil/FinalPictures/"&"1.jpg")
    links.Put(imageviewbackground, "http://lala/clickfight/UsersImages/"&userid&"/MeuPerfil/NaoEnviadas/FinalPictures/"&"1.jpg")
    CallSubDelayed2(ImageDownloader, "Download", links)

    Else If kv.GetSimple("imgcrop") = "0" Then
    CallSub(ImageDownloader, "ClearCache")
    links.Put(ImageView1, "http://lala/clickfight/UsersImages/"&userid&"/MeuPerfil/FinalPictures/"&"0.jpg")
    links.Put(imageviewbackground, "http://lala/clickfight/UsersImages/"&userid&"/MeuPerfil/NaoEnviadas/FinalPictures/"&"0.jpg")
    CallSubDelayed2(ImageDownloader, "Download", links)
    Else
    Msgbox("Ocorreu um erro ao resgatar imagem", "Click Fight")
    CallSub(ImageDownloader, "ClearCache")
    CallSub(ImageDownloader, "ActivityIsPaused")
    Activity.RemoveAllViews
    Activity.Finish
    End If

    ProgressDialogHide
End Sub


when i close this activity i use this to
1° clear cache
2° close imagedownloader
3° remove all views
4°activity.finish

B4X:
CallSub(ImageDownloader, "ClearCache")
    CallSub(ImageDownloader, "ActivityIsPaused")
    Activity.RemoveAllViews
    Activity.Finish


and i have same problem
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…