openhab-android
openhab-android copied to clipboard
WebView refreshes to the main page when rotating device
Actual behaviour
WebView refreshes to the main page when rotating device
For example, randomly browser in the webview. Before rotation:

After rotation:
Expected behaviour
The loaded web page should remain unchanged
Steps to reproduce
Already mentioned above
Can you reproduce the issue in demo mode?
yes
Environment data
Client
- Android version: 10
- Device model: emulator
- App version : 2.19.0
- Build flavor :
- Device language:
Server
- Server version:
- Reverse Proxy:
- Authentication method :
openHAB Cloud
- Self hosted cloud or myopenhab.org:
- openHAB Cloud version :
- Authentication method :
Logs
App log
Click to expand
Please add the app log if the issue is not a pure UI issue or it cannot be reproduced in demo mode.
Open the app, go to `Settings` => `View log` and insert the log here.
openHAB Server log
Click to expand
Not required.
If you have installed openHAB via `apt-get`, the log is located under `/var/log/openhab2/openhab.log`
Duplicate of https://github.com/openhab/openhab-android/issues/2606
Is it fixed now? Seems I can still reproduce the issue in 3.7.0. I can also observe the issue from Frontail.
Also still happening for me on OH 4.1.0 and app 3.10.
@florian-h05 ping as desired ;-) Reference for restoring the URL: we do this here
Thanks for pinging.
First question: Is it really required and cannot be avoided that the Android WebView reloads on every orientation change?
Second: Main UI still is not perfect with encoding its current navigation into the navigation route, it now does this for tabs as well (not sure if I added that before or after 4.2.0), but for the popup based stuff like the semantic model cards, this is not implemented. Overall it’s not easy to do that I think due to the way framework7 opens its modals. Those models usually modify the navigation route, but there is no actual route defined for them in the route so you cannot load the application into that modal. I can have a look at improving that if you say there is no other way though.
First question: Is it really required and cannot be avoided that the Android WebView reloads on every orientation change?
Yes. This is related to having differing layouts for portrait and landscape orientation. The activity is recreated and all views within are recreated with it. One can avoid recreation by specifying the 'orientation' value for configChanges in the manifest, but that only works properly for pure WebView activities (that is, the only layout element is a WebView), which isn't the case for us, since for sitemaps we switch between a one and a two pane layout.