S samannnn Member Dec 13, 2023 #1 i have some activity with portrait and two activities that i set landscape with this code: B4X: Copy Sub Globals Dim ph1 As Phone End Sub Sub Activity_Create(FirstTime As Boolean) ph1.SetScreenOrientation(0) '-1 Unspecified, 0 - Landscape, 1 - Portrait End Sub when i switch from on landscape activity to another landscape activity, first it switch to portrait and then goes to landscape Orientation. how can i handle this problem? tnx for your replies.
i have some activity with portrait and two activities that i set landscape with this code: B4X: Copy Sub Globals Dim ph1 As Phone End Sub Sub Activity_Create(FirstTime As Boolean) ph1.SetScreenOrientation(0) '-1 Unspecified, 0 - Landscape, 1 - Portrait End Sub when i switch from on landscape activity to another landscape activity, first it switch to portrait and then goes to landscape Orientation. how can i handle this problem? tnx for your replies.
S samannnn Member Dec 13, 2023 #2 in attach a small gif to show problem. Attachments Rec 0005.zip Rec 0005.zip 194.8 KB · Views: 412 Upvote 0
S samannnn Member Dec 16, 2023 #3 i found the solution: Better solution when you don't need to make the changes at runtime: https://www.b4x.com/android/forum/t...-of-an-activity-reflection.52169/#post-326665 B4X: Copy SetActivityAttribute(Main, android:screenOrientation, "portrait") SetActivityAttribute(Extra, android:screenOrientation, "landscape") Upvote 0
i found the solution: Better solution when you don't need to make the changes at runtime: https://www.b4x.com/android/forum/t...-of-an-activity-reflection.52169/#post-326665 B4X: Copy SetActivityAttribute(Main, android:screenOrientation, "portrait") SetActivityAttribute(Extra, android:screenOrientation, "landscape")