Android Question query with OutOfMemoryError

Douglas Farias

Expert
Licensed User
Longtime User
Hi all, m trying to find a solution for my problem but i really dont know what make now

ok, i need make a query to get 100 movies on my db, with image, description, title etc.
i m using customlistview for add the movies on the screen

when i need check for new movies i made clv.clear
and to download images i m using
picasso1.LoadUrl(capa_img).SkipCache.IntoImageView(capa)
with imagedownloader i have same problem, but for now i m using picasso

ok

java.lang.OutOfMemoryError

what can i make for dont have outoffmemory? i really dont see any erro on this result
i have clear the customlistview all time when i make a query



B4X:
        Case "verificaupdates"
        simcategoria = False
        painelseries.visible = False
        painelsobre.Visible = False
        listacategorias.Visible = False
        Dim parser As JSONParser
        clv.Clear
        parser.Initialize(Job.GetString)
        Dim root As List = parser.NextArray
        For Each colroot As Map In root
        Dim capa_img As String = colroot.Get("capa_img")
        Dim id As String = colroot.Get("id")
        Dim titulo As String = colroot.Get("titulo")
        Dim descricaocurta As String = colroot.Get("descricaocurta")
        Dim pa As Panel
        pa.Initialize("")
        clv.Add(pa, 65%y, id)
        pa.LoadLayout("ListItem")
        lbtitulo.Typeface = fonte
        lbdescricao.Typeface = fonte
        lbtitulo.Text = titulo
        lbdescricao.Text = descricaocurta
        picasso1.LoadUrl(capa_img).SkipCache.IntoImageView(capa)
        Next
        myProgressDialog.Hide
        End Select
        Else
        myProgressDialog.Hide
        ToastMessageShow("Erro de conexão!", True)
        End If
        Job.Release


here is the full log



here is the result with imagedownloader, same error
B4X:
        Case "verificaupdates"
        simcategoria = False
        painelseries.visible = False
        painelsobre.Visible = False
        listacategorias.Visible = False
        Dim parser As JSONParser
        Dim M As Map
        M.Initialize
        M.Clear
        clv.Clear
        CallSub(ImageDownloader, "ClearCache")
        parser.Initialize(Job.GetString)
        Dim root As List = parser.NextArray
        For Each colroot As Map In root
        Dim capa_img As String = colroot.Get("capa_img")
        Dim id As String = colroot.Get("id")
        Dim titulo As String = colroot.Get("titulo")
        Dim descricaocurta As String = colroot.Get("descricaocurta")
        Dim pa As Panel
        pa.Initialize("")
        clv.Add(pa, 65%y, id)
        pa.LoadLayout("ListItem")
        lbtitulo.Typeface = fonte
        lbdescricao.Typeface = fonte
        lbtitulo.Text = titulo
        lbdescricao.Text = descricaocurta
        M.Put(capa, capa_img)
        Next
        CallSubDelayed2(ImageDownloader, "Download", M)
        myProgressDialog.Hide
 
Last edited:
Cookies are required to use this site. You must accept them to continue using the site. Learn more…