My project includes B4XMainPage and RunActivity. I am using UDPSkt for the communication. APP automatically closes when i change the orientation when i am on B4XMainPage. I have attached error message
Following is the code added in sub B4XPage_Created.
B4XPage Created:
If UDPSkt.IsInitialized=False Then
UDPSkt.Initialize("UDP",4211,255)
End If
Please note: I do not face error while I am in RunActivity.
Erel, Thank you for the response. Earlier it was working fine. I mean, it supported orientation in old version.
By the way, Orientation works perfect for RunActivity page.
Meanwhile...Can u explain any other solution to support orientation as you have mentioned "with B4X pages, orientation must be locked". I mean, can i replace B4X main page with any other page? I think, this limitation (portrait or landscape) seems bottleneck for B4A.
It was never supported. It is possible that you didn't notice this problem before. B4XPages makes many things much simpler: [B4X] [B4XPages] What exactly does it solve?
And this requires locking the orientation.
Dear Erel, My project includes 2 layouts. B4XMainPage opens opens first layout and RunActivity opens second layout.
Second layout which is loaded from RunActivity works fine in both (portrait and landscape) modes however first layout which is opened from B4XMain page throws the error.
Is there any solution that APP while in first layout (opened from B4XMainPage) will not change the orientation? means first layout will remained locked to portrait or landscape.
See, i would like to give flexibility to user to use any orientation. Generally, tab users will be comfortable in landscape and mobile user will be comfortable in portrait.
Try to lock the orientation with Phone.SetScreenOrientation in Activity_Create. I don't know what is "RunActivity" but if it is a second activity then you are probably doing something wrong.