Hide control create a runtime

arenaluigi

Well-Known Member
Licensed User
Longtime User
Sorry my bad english.

I have 2 Activity A and B.
A calls B, B is designed with the designer and is the central part that I create at code runtime, this is code:
B4X:
Activity.LoadLayout("blacklist")
   IBnomeBlackList.Hint="Nome lista"
   scrlDati.Initialize(0)
   PnlBody=scrlDati.Panel
   Activity.AddView(scrlDati,0,PnlHeader.Height+10, 100%x, 75%y)
   
   'preparo label che conterrà le liste   
   Cols(0) = Colors.Black
   Cols(1) = Colors.Black
   gdwGradient.Initialize("TOP_BOTTOM",Cols)
   gdwGradient.CornerRadius = 10dip
   Dim lblDato(nrec) As Label
   For x=0 To lblDato.Length-1
      cursore.Position=x
      lblDato(x).Initialize("label")
      lblDato(x).Background = gdwGradient
      lblDato(x).Text= cursore.GetString("nome")
      lblDato(x).TextColor=Colors.White
      lblDato(x).Typeface=gdTypeFace.CreateNew(Typeface.DEFAULT,Typeface.STYLE_BOLD)
      lblDato(x).TextSize=20
      lblDato(x).Gravity= Bit.Or(Gravity.CENTER, Gravity.CENTER_HORIZONTAL)
      PnlBody.AddView(lblDato(x),10,y,95%x,35)
      PnlBody.Height = (x+1) * 40
      y=y+40
      Log(x)
   Next
   PnlBottom.Top=Activity.Height-PnlHeader.Height-10dip

When B is active, and i press the button "BACK" i return in activity A.
When I return in activity B, all the views created at runtime does not see them anymore. Why?

Thank's
 
Top