I finally get Pause and Resume to manage the views on a screen rotation but now ImageVeiw2 does not display when the app starts up. (Because of the last line in Resume).
B4X:
Sub Process_Globals
Public VisiBL As Boolean
Public notVisiBL As Boolean
End Sub
Sub Activity_Resume
Label1.Visible = VisiBL
ImageView1.Visible=VisiBL
ImageView2.Visible = notVisiBL ' This stops ImageView2 being visible on startup only.
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If Label1.Visible = True Then
VisiBL = True
notVisiBL = False
Label1.Visible = VisiBL
ImageView1.Visible = VisiBL
ImageView2.Visible = notVisiBL
Else
VisiBL = False
notVisiBL = True
Label1.Visible = notVisiBL
ImageView1.Visible = notVisiBL
ImageView2.Visible = VisiBL
End If
End Sub
I read something about Designer Scripts but since Sub_Resume is the last thing that happens the problem remains.
This in no way solves your problem .. But I found it difficult to study your code ie.
B4X:
If Label1.Visible = TrueThen
VisiBL = True
notVisiBL = False
Label1.Visible = VisiBL
ImageView1.Visible = VisiBL
ImageView2.Visible = notVisiBL
Else
VisiBL = False
notVisiBL = True
Label1.Visible = notVisiBL '@@ initially I thought Label1 was NOT visible ... But notVisiBL = True .. so it Is Visable
ImageView1.Visible = notVisiBL ' same here
ImageView2.Visible = VisiBL 'The reverse here .. ImageView2 is Visable ... No it is NOT Visible.
End If
Personally I would remove the Process Globals and just set the views.Visible property True or False.
This in no way solves your problem .. But I found it difficult to study your code ie.
B4X:
If Label1.Visible = TrueThen
VisiBL = True
notVisiBL = False
Label1.Visible = VisiBL
ImageView1.Visible = VisiBL
ImageView2.Visible = notVisiBL
Else
VisiBL = False
notVisiBL = True
Label1.Visible = notVisiBL '@@ initially I thought Label1 was NOT visible ... But notVisiBL = True .. so it Is Visable
ImageView1.Visible = notVisiBL ' same here
ImageView2.Visible = VisiBL 'The reverse here .. ImageView2 is Visable ... No it is NOT Visible.
End If
Personally I would remove the Process Globals and just set the views.Visible property True or False.
since ImageView and Label aren't UI views StateManager isn't the ticket, so I'm still at it. Am removing the Process_Globals and trying to make a variable that solves this. thanks.