Is there a way in b4a to persist a webview when the orientation is changed?
We can obviously get the url and reload it, but what if the user has entered some data and then decides to rotate. All is lost.
Searching on net shows the use of manifest edit
but it requires
something that doesn't seem to be inplemented in b4a
Another option documented in java is to
and
If this method is possible with JavaObject or Reflector, I have no idea how to do it.
Ideas?
We can obviously get the url and reload it, but what if the user has entered some data and then decides to rotate. All is lost.
Searching on net shows the use of manifest edit
B4X:
android:configChanges="orientation|screenSize"
but it requires
B4X:
onconfigurationchange()
something that doesn't seem to be inplemented in b4a
Another option documented in java is to
B4X:
protected void onSaveInstanceState(Bundle outState) {
webView.saveState(outState);
}
and
B4X:
public void onCreate(final Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.blah);
if (savedInstanceState != null)
((WebView)findViewById(R.id.webview)).restoreState(savedInstanceState);
}
If this method is possible with JavaObject or Reflector, I have no idea how to do it.
Ideas?