S ssdzkrez Member Dec 13, 2013 #1 Hello friends! I'm learning B4A, and I have question ... maybe stupid one. I have a simple application: Code: Copy Sub Activity_Create (FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: 'Activity.LoadLayout("Layout1") Msgbox("FirstTime","") End Sub Sub Activity_Resume Msgbox("Resume","") End Sub When I change screen orientation in emulator or on real device, the application resets. Debug messages: - application start ... ** Activity (main) Create, isFirst = true ** i click OK in msgbox ... ** Activity (main) Resume ** i have now Resume msgbox - when I change screen orientation ... ** Activity (main) Pause, UserClosed = false ** ** Activity (main) Create, isFirst = false ** - I get msgbox "FirstTime". Why ... ifFirst = false?
Hello friends! I'm learning B4A, and I have question ... maybe stupid one. I have a simple application: Code: Copy Sub Activity_Create (FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: 'Activity.LoadLayout("Layout1") Msgbox("FirstTime","") End Sub Sub Activity_Resume Msgbox("Resume","") End Sub When I change screen orientation in emulator or on real device, the application resets. Debug messages: - application start ... ** Activity (main) Create, isFirst = true ** i click OK in msgbox ... ** Activity (main) Resume ** i have now Resume msgbox - when I change screen orientation ... ** Activity (main) Pause, UserClosed = false ** ** Activity (main) Create, isFirst = false ** - I get msgbox "FirstTime". Why ... ifFirst = false?
S ssdzkrez Member Dec 13, 2013 #2 I found an answers. That's how android works ... when device is rotated, the activity re-starting. Upvote 0