danijel Active Member Licensed User Longtime User Nov 12, 2016 #1 Is there way to "refresh" Activity.Width after HeightChanged? I need it on orientation change. With this code Activity width and height is always the same after orientation change... Code: Copy Sub IME1_HeightChanged(NewHeight As Int, OldHeight As Int) ToastMessageShow("Width= " & Activity.Width & CRLF & _ "Height= " & Activity.Height, False) End Sub
Is there way to "refresh" Activity.Width after HeightChanged? I need it on orientation change. With this code Activity width and height is always the same after orientation change... Code: Copy Sub IME1_HeightChanged(NewHeight As Int, OldHeight As Int) ToastMessageShow("Width= " & Activity.Width & CRLF & _ "Height= " & Activity.Height, False) End Sub
Erel B4X founder Staff member Licensed User Longtime User Nov 13, 2016 #2 The activity will be recreated after the orientation changes. The width will be updated automatically. Upvote 0
The activity will be recreated after the orientation changes. The width will be updated automatically.
danijel Active Member Licensed User Longtime User Nov 13, 2016 #3 Thx Erel, but I have this in manifest: Code: Copy SetActivityAttribute(Main, android:configChanges, "orientation|keyboardHidden|screenSize") So activity will not recreate. I am just curious is it possible to just refresh width and height without recreating all activity and remember all view states. Upvote 0
Thx Erel, but I have this in manifest: Code: Copy SetActivityAttribute(Main, android:configChanges, "orientation|keyboardHidden|screenSize") So activity will not recreate. I am just curious is it possible to just refresh width and height without recreating all activity and remember all view states.
Erel B4X founder Staff member Licensed User Longtime User Nov 13, 2016 #4 It is better to use the standard Android way of dealing with orientation changes. See this link for a possible workaround: https://www.b4x.com/android/forum/threads/persist-webview-through-orientation-change.37511/#content Upvote 0
It is better to use the standard Android way of dealing with orientation changes. See this link for a possible workaround: https://www.b4x.com/android/forum/threads/persist-webview-through-orientation-change.37511/#content
danijel Active Member Licensed User Longtime User Nov 13, 2016 #5 It works. thank you very much Upvote 0