F ftuz13 Member Licensed User Longtime User Jul 6, 2017 #1 Following is my code: Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: 'Activity.LoadLayout("Layout1") MyOfficeWeb End Sub Sub MyOfficeWeb Dim myw As WebView myw.Initialize("myw") Activity.AddView(myw, 0, 0, 100%x, 100%y) 'Your options for size here myw.LoadUrl("http://k13.anewas.com/") End Sub When the phone orientation change from landscape to portrait it lost all the data.
Following is my code: Sub Activity_Create(FirstTime As Boolean) 'Do not forget to load the layout file created with the visual designer. For example: 'Activity.LoadLayout("Layout1") MyOfficeWeb End Sub Sub MyOfficeWeb Dim myw As WebView myw.Initialize("myw") Activity.AddView(myw, 0, 0, 100%x, 100%y) 'Your options for size here myw.LoadUrl("http://k13.anewas.com/") End Sub When the phone orientation change from landscape to portrait it lost all the data.
R ronell Well-Known Member Licensed User Longtime User Jul 6, 2017 #2 imrpk said: When the phone orientation change from landscape to portrait it lost all the data. Click to expand... when the phone changes orientation.. the app will go back to Code: Copy Sub Activity_Create(FirstTime As Boolean) see this: https://www.b4x.com/android/forum/threads/android-process-and-activities-life-cycle.6487/ Upvote 0
imrpk said: When the phone orientation change from landscape to portrait it lost all the data. Click to expand... when the phone changes orientation.. the app will go back to Code: Copy Sub Activity_Create(FirstTime As Boolean) see this: https://www.b4x.com/android/forum/threads/android-process-and-activities-life-cycle.6487/
F ftuz13 Member Licensed User Longtime User Jul 6, 2017 #3 ronell said: when the phone changes orientation.. the app will go back to Code: Copy Sub Activity_Create(FirstTime As Boolean) see this: https://www.b4x.com/android/forum/threads/android-process-and-activities-life-cycle.6487/ Click to expand... Thanks. Guide solution for this please. Upvote 0
ronell said: when the phone changes orientation.. the app will go back to Code: Copy Sub Activity_Create(FirstTime As Boolean) see this: https://www.b4x.com/android/forum/threads/android-process-and-activities-life-cycle.6487/ Click to expand... Thanks. Guide solution for this please.
Erel B4X founder Staff member Licensed User Longtime User Jul 6, 2017 #4 The simple solution is to disable orientation changes in the relevant activity. You can search the forum for ConfigChanges for a more complex and less recommended solution. Upvote 0
The simple solution is to disable orientation changes in the relevant activity. You can search the forum for ConfigChanges for a more complex and less recommended solution.
tigrot Well-Known Member Licensed User Longtime User Jul 6, 2017 #5 Reload all data with new screen format. If you entered data in web input form you will loose them... As Erel pointed, you better disable orientation changes while in this activity. You will get better results in web pages. Upvote 0
Reload all data with new screen format. If you entered data in web input form you will loose them... As Erel pointed, you better disable orientation changes while in this activity. You will get better results in web pages.
tigrot Well-Known Member Licensed User Longtime User Jul 6, 2017 #6 https://www.b4x.com/android/forum/threads/persist-webview-through-orientation-change.37511/ https://www.b4x.com/android/forum/threads/persist-webview-through-orientation-change.37511/ you can try this solution as well. Upvote 0
https://www.b4x.com/android/forum/threads/persist-webview-through-orientation-change.37511/ https://www.b4x.com/android/forum/threads/persist-webview-through-orientation-change.37511/ you can try this solution as well.
R ronell Well-Known Member Licensed User Longtime User Jul 6, 2017 #7 i also had an app with webview, solved it as what erel suggest Erel said: he simple solution is to disable orientation changes in the relevant activity. Click to expand... Upvote 0
i also had an app with webview, solved it as what erel suggest Erel said: he simple solution is to disable orientation changes in the relevant activity. Click to expand...
F ftuz13 Member Licensed User Longtime User Jul 6, 2017 #8 For Now disable orientation is the best solution Thanks to all Upvote 0