Hi,
I have a routines that downloads images from my server to a tableview.
Each time I call this routine I loose heaps of ram.
What I assume is the memory used in the creation of the table is not freed before it is loaded again.
Any thoughts.
Tom
I have a routines that downloads images from my server to a tableview.
Each time I call this routine I loose heaps of ram.
What I assume is the memory used in the creation of the table is not freed before it is loaded again.
Any thoughts.
B4X:
tblImages.Items.Clear
tblImages.SetColumns(Array As String("id", "Name","Image"))
Dim im As Map
im.Initialize
If AllImages.IsInitialized Then
If AllImages.Size>0 Then AllImages.Clear
Else
AllImages.Initialize
End If
' fill here
Dim jp As JSONParser
jp.Initialize(Json)
If jp <> Null Then
Dim mz As Map = jp.NextObject
Dim lst As List = mz.Get("json")
For i = 0 To lst.Size -1
Dim m As Map = lst.Get(i)
m.Put("updt",0)
Dim row(3) As Object
row(0) = m.Get("id")
Dim p As AnchorPane
p.Initialize("")
p.LoadLayout("EditImage")
labFileName.Text = m.Get("filename")
edtName.Text = m.Get("name")
edtAltName.Text = m.Get("alt")
edtName.Tag = i
edtAltName.Tag = i
cbDelete.Checked = False
cbDelete.Tag = i
row(1) = p
AllImages.Add(m) ' add info to list
Dim img As ImageView
img.Initialize("me")
im.Put(img, Serverlink & "/images/" & m.Get("filename"))
row(2) = img
tblImages.Items.Add(row)
Next
Dim id As ImageDownloader
id.Initialize
id.Download(im)
tblImages.SetColumnWidth(0,0)
tblImages.SetColumnWidth(1,300)
tblImages.SetColumnWidth(2,tblImages.Width - 320)
tblImages.Visible = True
Tom