angel_ Well-Known Member Licensed User Longtime User Sep 20, 2021 #1 I have the same problem, every time the screen is rotated (I only have 1 Page) the created event is fired, How I can get FirsTime = True when the app starts and False when it rotates? [SOLVED] [B4X] MainPage FirstTime Hello With the Default method on Activity_Create we can check FirstTime run. With B4XPages how we can check FirstTime? Thank you. www.b4x.com
I have the same problem, every time the screen is rotated (I only have 1 Page) the created event is fired, How I can get FirsTime = True when the app starts and False when it rotates? [SOLVED] [B4X] MainPage FirstTime Hello With the Default method on Activity_Create we can check FirstTime run. With B4XPages how we can check FirstTime? Thank you. www.b4x.com
Erel B4X founder Staff member Licensed User Longtime User Sep 20, 2021 #2 The B4XPages activity orientation must be locked: https://www.b4x.com/android/forum/t...k-for-managing-multiple-pages.118901/#content If you want to support multiple orientations then either don't use B4XPages or add a second activity outside of B4XPages. Example of the second option: https://www.b4x.com/android/forum/threads/exoplayer-full-screen-feature.132854/#content Upvote 0
The B4XPages activity orientation must be locked: https://www.b4x.com/android/forum/t...k-for-managing-multiple-pages.118901/#content If you want to support multiple orientations then either don't use B4XPages or add a second activity outside of B4XPages. Example of the second option: https://www.b4x.com/android/forum/threads/exoplayer-full-screen-feature.132854/#content
angel_ Well-Known Member Licensed User Longtime User Sep 20, 2021 #3 Erel said: The B4XPages activity orientation must be locked: https://www.b4x.com/android/forum/t...k-for-managing-multiple-pages.118901/#content Click to expand... I only have one activity I thought of two options: Code: Copy Sub Process_Globals Public FirstTime As Boolean End Sub Sub Service_Create FirstTime = True End Sub or Code: Copy Sub Process_Globals Public FirstTimeMain As Boolean End Sub Sub Activity_Create(FirstTime As Boolean) FirstTimeMain = FirstTime Dim pm As B4XPagesManager pm.Initialize(Activity) End Sub Then: Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 '...code If Starter.FirstTime Then 'or If Main.FirstTimeMain Then 'code FirstTime Else 'code No FirstTime End If End Sub Which is the best option? Upvote 0
Erel said: The B4XPages activity orientation must be locked: https://www.b4x.com/android/forum/t...k-for-managing-multiple-pages.118901/#content Click to expand... I only have one activity I thought of two options: Code: Copy Sub Process_Globals Public FirstTime As Boolean End Sub Sub Service_Create FirstTime = True End Sub or Code: Copy Sub Process_Globals Public FirstTimeMain As Boolean End Sub Sub Activity_Create(FirstTime As Boolean) FirstTimeMain = FirstTime Dim pm As B4XPagesManager pm.Initialize(Activity) End Sub Then: Code: Copy Private Sub B4XPage_Created (Root1 As B4XView) Root = Root1 '...code If Starter.FirstTime Then 'or If Main.FirstTimeMain Then 'code FirstTime Else 'code No FirstTime End If End Sub Which is the best option?
Erel B4X founder Staff member Licensed User Longtime User Sep 21, 2021 #4 angel_ said: Which is the best option? Click to expand... If you want to support multiple orientations then either don't use B4XPages or add a second activity outside of B4XPages. Upvote 0
angel_ said: Which is the best option? Click to expand... If you want to support multiple orientations then either don't use B4XPages or add a second activity outside of B4XPages.