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 ¬¬ ?


(Intent) Intent { act=android.intent.action.MAIN flg=0x20000000 cmp=click.fight.vallow/.main }
no extras
** Activity (main) Pause, UserClosed = false **
** Activity (main) Create, isFirst = true **
** Activity (main) Resume **
** Activity (main) Pause, UserClosed = false **
** Activity (perfil) Create, isFirst = true **
** Activity (perfil) Resume **
** Service (imagedownloader) Create **
** Service (imagedownloader) Start **
** Service (httputils2service) Create **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Service (httputils2service) Start **
** Activity (perfil) Pause, UserClosed = false **
** Activity (crop) Create, isFirst = true **
** Activity (crop) Resume **
** Activity (crop) Pause, UserClosed = true **
** Activity (perfil) Resume **
** Activity (perfil) Pause, UserClosed = false **
** Activity (crop) Create, isFirst = false **
** Activity (crop) Resume **
** Activity (crop) Pause, UserClosed = true **
** Activity (perfil) Resume **
** Activity (perfil) Pause, UserClosed = false **
** Activity (crop) Create, isFirst = false **
** Activity (crop) Resume **
** Activity (crop) Pause, UserClosed = true **
** Activity (perfil) Resume **
** Activity (perfil) Pause, UserClosed = false **
** Activity (crop) Create, isFirst = false **
** Activity (crop) Resume **
** Activity (crop) Pause, UserClosed = true **
** Activity (perfil) Resume **
** Activity (perfil) Pause, UserClosed = false **
** Activity (crop) Create, isFirst = false **
** Activity (crop) Resume **
** Activity (crop) Pause, UserClosed = true **
** Activity (perfil) Resume **
** Activity (perfil) Pause, UserClosed = false **
** Activity (crop) Create, isFirst = false **
** Activity (crop) Resume **
** Activity (crop) Pause, UserClosed = true **
** Activity (perfil) Resume **
** Activity (perfil) Pause, UserClosed = false **
** Activity (crop) Create, isFirst = false **
** Activity (crop) Resume **
** Activity (crop) Pause, UserClosed = true **
** Activity (perfil) Resume **
** Activity (perfil) Pause, UserClosed = false **
** Activity (crop) Create, isFirst = false **
** Activity (crop) Resume **
** Activity (crop) Pause, UserClosed = true **
** Activity (perfil) Resume **
** Activity (perfil) Pause, UserClosed = false **
** Activity (crop) Create, isFirst = false **
** Activity (crop) Resume **
Downsampling image due to lack of memory.
** Activity (crop) Pause, UserClosed = true **
** Activity (perfil) Resume **
** Activity (perfil) Pause, UserClosed = false **
** Activity (crop) Create, isFirst = false **
Downsampling image due to lack of memory.
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
Downsampling image due to lack of memory.
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
Downsampling image due to lack of memory.
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
Downsampling image due to lack of memory.
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
Downsampling image due to lack of memory.
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
Downsampling image due to lack of memory.
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
Downsampling image due to lack of memory.
Downsampling image due to lack of memory: 2
Downsampling image due to lack of memory: 4
** Activity (main) Resume **
 

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 o_O
 
Upvote 0
Top