Strange activity with Activity!

AscySoft

Active Member
Licensed User
Longtime User
B4X:
'Activity module
Sub Process_Globals
   'These global variables will be declared once when the application starts.
   'These variables can be accessed from all modules.
Dim nr As Int :nr=0
End Sub

Sub Globals
   'These global variables will be redeclared each time the activity is created.
   'These variables can only be accessed from this module.

   Dim Panel1 As Panel
   Dim ScrollView1 As ScrollView
End Sub

Sub Activity_Create(FirstTime As Boolean)
'Activity .LoadLayout ("L1")
'panel1.Width =activity.Width 
nr=nr+1
ToastMessageShow("Changes: " & nr,False)
End Sub

Sub Activity_Resume

End Sub

Sub Activity_Pause (UserClosed As Boolean)

End Sub
The problem is that when I change orientation(Ctrl+F11 on emulator) from landscape to portrait, Sub Activity_Create will trigger twice not once.
Why? It seems easy, but I did not find the answer. :BangHead:
 

AscySoft

Active Member
Licensed User
Longtime User
Top