Note that you should not check these values only when FirstTime is true. When the device is rotated the activity is recreated and FirstTime will be false.
Sub Activity_Create (FirstTime As Boolean)
If FirstTime = True Then
'here you should initialize process global objects
End If
'Load layout and configure it
Dim lv As LayoutValues
lv = GetDeviceLayoutValues
Log(lv)
...
End Sub
Activity_Create will always be called when the orientation is changed. Setting the layout in Activity_Resume will also work but is less efficient as Activity_Resume can be called many times (each time your activity becomes visible).
In a brief, each time your activity is going to the background Activity_Pause is called and when it becomes visible Activity_Resume is called.
The activity might be destroyed in between so these are important methods.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.