I guess I'm missing the obvious but .....
I have a main view which is called in activity_create thus
and in that view is a button, the click event of which is this
(The sub routine RemoveViews is nothing other than a copy of the sub given in the tutorial working with views. )
screen2 has 2 variants, 1 for portrait and 1 for landscape. If screen2 is the active view I had hoped that a screen orientation change would result in screen2 still being in view, but for some reason after such an orientation change the loaded view is "main". Could someone put me out of my misery and explain what i am doing wrong please. Many thanks.
I have a main view which is called in activity_create thus
B4X:
If FirstTime Then
Gps1.Initialize("GPS")
Activity.LoadLayout("main")
createDirectory
End If
and in that view is a button, the click event of which is this
B4X:
Sub btnMain_Click
RemoveViews
Activity.LoadLayout("screen2")
End Sub
(The sub routine RemoveViews is nothing other than a copy of the sub given in the tutorial working with views. )
screen2 has 2 variants, 1 for portrait and 1 for landscape. If screen2 is the active view I had hoped that a screen orientation change would result in screen2 still being in view, but for some reason after such an orientation change the loaded view is "main". Could someone put me out of my misery and explain what i am doing wrong please. Many thanks.