JonPM Well-Known Member Licensed User Longtime User Nov 8, 2015 #1 I need my app to run portrait on phones and landscape on tablets. First I determine device: Code: DeviceScreenSize = Ceil(GetDeviceLayoutValues.ApproximateScreenSize) If DeviceScreenSize < 7 Then Starter.DeviceType = "Phone" p.SetScreenOrientation(1) Else Starter.DeviceType = "Tablet" p.SetScreenOrientation(0) End If Then when switching activities i set the orientation: Code: If Starter.DeviceType = "Phone" Then p.SetScreenOrientation(1) Else p.SetScreenOrientation(0) End If The problem is on my tablet (Galaxy Tab 2) there is significant delay (~2-3 secs) when switching activities. Also, as expected, it is causing Activity_Pause and Activity_Resume to be called an additional time which is throwing off some of my other code. Is there a better way to handle this? I have set the Project Attributes in Main to Portrait, as I believe majority of users will be using app on a phone.
I need my app to run portrait on phones and landscape on tablets. First I determine device: Code: DeviceScreenSize = Ceil(GetDeviceLayoutValues.ApproximateScreenSize) If DeviceScreenSize < 7 Then Starter.DeviceType = "Phone" p.SetScreenOrientation(1) Else Starter.DeviceType = "Tablet" p.SetScreenOrientation(0) End If Then when switching activities i set the orientation: Code: If Starter.DeviceType = "Phone" Then p.SetScreenOrientation(1) Else p.SetScreenOrientation(0) End If The problem is on my tablet (Galaxy Tab 2) there is significant delay (~2-3 secs) when switching activities. Also, as expected, it is causing Activity_Pause and Activity_Resume to be called an additional time which is throwing off some of my other code. Is there a better way to handle this? I have set the Project Attributes in Main to Portrait, as I believe majority of users will be using app on a phone.
Erel B4X founder Staff member Licensed User Longtime User Nov 9, 2015 #2 You can start a different activity for tablets and restrict it to landscape. You can use a class to implement most of the "activity code" and then reuse it. Upvote 0
You can start a different activity for tablets and restrict it to landscape. You can use a class to implement most of the "activity code" and then reuse it.
JonPM Well-Known Member Licensed User Longtime User Nov 9, 2015 #3 Wouldn't it cause the same issue since my Project Attributes in Main sets the orientation to Portrait? Upvote 0
Wouldn't it cause the same issue since my Project Attributes in Main sets the orientation to Portrait?
Erel B4X founder Staff member Licensed User Longtime User Nov 9, 2015 #4 Maybe. It is worth doing a small test... Upvote 0