i spent 2 days on finding a bug in my app but then i learned something new on nodes (views).
logs:
so what we can see here is that after i remove the view it is still available and i can reuse it if i want but my question is, if i have a scrollview where i load views to it and then i remove them and load again ... now if the old views are still somewhere in space will it affect the phone memory? i believe that if i still can get to that view that it is stored somewhere so it is using memory so if i have a clv and i add lots of views to it then clear the clv and add again views so it can happen that there are 1000s of views that i don't really need and they are using memory, how can i remove a view completely? or it is normal like that and i should not deal with this issue too much?
thanx, ilan
B4X:
Sub Process_Globals
Private fx As JFX
Private MainForm As Form
Private mybtn As Button
End Sub
Sub AppStart (Form1 As Form, Args() As String)
MainForm = Form1
'MainForm.RootPane.LoadLayout("Layout1") 'Load the layout file.
MainForm.Show
mybtn.Initialize("")
mybtn.Text = "test"
mybtn.TextColor = fx.Colors.Black
MainForm.RootPane.AddNode(mybtn,0,0,100,50)
Sleep(2000)
mybtn.RemoveNodeFromParent
Sleep(2000)
Log(mybtn.Text)
mybtn.Text = "test2"
Sleep(2000)
Log(mybtn.Text)
Log(mybtn.Visible)
Log(mybtn.Enabled)
Log(mybtn.IsInitialized)
End Sub
logs:
Waiting for debugger to connect...
Program started.
test
test2
true
true
true
so what we can see here is that after i remove the view it is still available and i can reuse it if i want but my question is, if i have a scrollview where i load views to it and then i remove them and load again ... now if the old views are still somewhere in space will it affect the phone memory? i believe that if i still can get to that view that it is stored somewhere so it is using memory so if i have a clv and i add lots of views to it then clear the clv and add again views so it can happen that there are 1000s of views that i don't really need and they are using memory, how can i remove a view completely? or it is normal like that and i should not deal with this issue too much?
thanx, ilan