J JoeR Member Licensed User Longtime User Feb 19, 2014 #1 What is the SetScreenOrientation value for unspecified in the Phone library? My app has several modules, one of which displays a map using osmdroid/mapview. Within that module (only) , I want to display an initial screen as landscape - but thereafter to "honour" the situation where a user rotates the device. In the other modules, I want to force landscape all the time. I would like to achieve this programmatically using phone (or another equivalent) library. I cannot use the #SupportedOrientations: parameter in Project Attributes as this applies across all modules all the time. The Phone library documentation says: SetScreenOrientation (Orientation As Int) Changes the current activity orientation. This method cannot be called from a service module. Orientation - -1 for unspecified, 0 for landscape and 1 for portrait. The (very simple) code that I currently use is: Code: Copy Sub Process_Globals Dim phone1 As Phone Sub Activity_Create(FirstTime As Boolean) phone1.SetScreenOrientation(0) ' force landscape for map
What is the SetScreenOrientation value for unspecified in the Phone library? My app has several modules, one of which displays a map using osmdroid/mapview. Within that module (only) , I want to display an initial screen as landscape - but thereafter to "honour" the situation where a user rotates the device. In the other modules, I want to force landscape all the time. I would like to achieve this programmatically using phone (or another equivalent) library. I cannot use the #SupportedOrientations: parameter in Project Attributes as this applies across all modules all the time. The Phone library documentation says: SetScreenOrientation (Orientation As Int) Changes the current activity orientation. This method cannot be called from a service module. Orientation - -1 for unspecified, 0 for landscape and 1 for portrait. The (very simple) code that I currently use is: Code: Copy Sub Process_Globals Dim phone1 As Phone Sub Activity_Create(FirstTime As Boolean) phone1.SetScreenOrientation(0) ' force landscape for map
Erel B4X founder Staff member Licensed User Longtime User Feb 19, 2014 #2 The value of unspecified is -1. Upvote 0
J JoeR Member Licensed User Longtime User Feb 19, 2014 #3 Thank you for the prompt response. I had misinterpreted the - - as punctuation! Upvote 0
antofer Member Licensed User Longtime User Mar 17, 2015 #4 Phone add the library and declare the variable but I can not assign ownership As p Private Phone p.SetScreenOrientation (0) 'or 1 Depending on the orientation you need. setScreenOrientation not exist as property I do wrong? Attachments p1.png 158.4 KB · Views: 524 Upvote 0
Phone add the library and declare the variable but I can not assign ownership As p Private Phone p.SetScreenOrientation (0) 'or 1 Depending on the orientation you need. setScreenOrientation not exist as property I do wrong?
NJDude Expert Licensed User Longtime User Mar 17, 2015 #5 What B4A version do you have? the Phone library is part of the B4A installation and the current version is 2.26. One more thing, please do not post the same question on several threads. Upvote 0
What B4A version do you have? the Phone library is part of the B4A installation and the current version is 2.26. One more thing, please do not post the same question on several threads.
antofer Member Licensed User Longtime User Mar 17, 2015 #6 I sorry phone library 1.34 version Upvote 0
antofer Member Licensed User Longtime User Mar 17, 2015 #7 this version I did not appear in the search results looking to download Upvote 0