Rotate device: App reloads overview-page
See original GitHub issueActual behaviour
Example:
- In local WiFi
- Open openHAB Android App --> Connected locally
- Opens openHAB 3 UI
- Go to custom subpage (e.g. Graph page)
- Rotate device (e.g. to have a better overview about the shown graphs)
- App seems to completely reload openHAB 3 UI and jumps back to Overview page
- I have to navigate the whole way to the custom page i want
Expected behaviour
- Currently open page stays open and is shown in new screen orientation
Steps to reproduce
- Open custom page
- Rotate the device
Environment data
Client
- Android version: 12 beta
- Device model: Pixel 3a
- App version : 2.17.3-beta
Logs
App log
Click to expand
-----------------------
Device information
Model: Pixel 3a
Manufacturer: Google
Brand: google
Device: sargo
Product: sargo
OS: 11
Display: 1080x2176, 2.3375 density
Data usage policy: DataUsagePolicy(canDoLargeTransfers=true, loadIconsWithState=true, autoPlayVideos=true, canDoRefreshes=true), data saver: 1, battery saver: false
-----------------------
--------- beginning of events
05-26 09:46:10.364 22698 22698 I wm_on_create_called: [117183046,org.openhab.habdroid.ui.MainActivity,performCreate]
05-26 09:46:10.383 22698 22698 I wm_on_start_called: [117183046,org.openhab.habdroid.ui.MainActivity,handleStartActivity]
05-26 09:46:10.402 22698 22698 I wm_on_resume_called: [117183046,org.openhab.habdroid.ui.MainActivity,RESUME_ACTIVITY]
05-26 09:46:10.427 22698 22698 I wm_on_top_resumed_gained_called: [117183046,org.openhab.habdroid.ui.MainActivity,topStateChangedWhenResumed]
05-26 09:46:26.187 22698 22698 I wm_on_top_resumed_lost_called: [117183046,org.openhab.habdroid.ui.MainActivity,pausing]
05-26 09:46:26.201 22698 22698 I wm_on_paused_called: [117183046,org.openhab.habdroid.ui.MainActivity,performPause]
05-26 09:46:26.206 22698 22698 I wm_on_stop_called: [117183046,org.openhab.habdroid.ui.MainActivity,handleRelaunchActivity]
05-26 09:46:26.325 22698 22698 I wm_on_destroy_called: [117183046,org.openhab.habdroid.ui.MainActivity,performDestroy]
05-26 09:46:26.432 22698 22698 I wm_on_create_called: [117183046,org.openhab.habdroid.ui.MainActivity,performCreate]
05-26 09:46:26.493 22698 22698 I wm_on_start_called: [117183046,org.openhab.habdroid.ui.MainActivity,handleStartActivity]
05-26 09:46:26.524 22698 22698 I wm_on_resume_called: [117183046,org.openhab.habdroid.ui.MainActivity,RESUME_ACTIVITY]
05-26 09:46:26.524 22698 22698 I wm_on_top_resumed_gained_called: [117183046,org.openhab.habdroid.ui.MainActivity,topWhenResuming]
05-26 09:46:30.048 22698 22698 I wm_on_top_resumed_lost_called: [117183046,org.openhab.habdroid.ui.MainActivity,topStateChangedWhenResumed]
05-26 09:46:30.055 22698 22698 I wm_on_paused_called: [117183046,org.openhab.habdroid.ui.MainActivity,performPause]
05-26 09:46:30.138 22698 22698 I wm_on_stop_called: [117183046,org.openhab.habdroid.ui.MainActivity,STOP_ACTIVITY_ITEM]
05-26 09:50:52.910 22698 22698 I wm_on_destroy_called: [117183046,org.openhab.habdroid.ui.MainActivity,performDestroy]
--------- beginning of main
05-26 09:50:53.276 22698 22698 D MainActivity: onCreate()
05-26 09:50:53.318 22698 22698 D ContentController: onRestoreInstanceState()
05-26 09:50:53.318 22698 22698 D PageConnectionHolderFragment: updateActiveConnections: URL list [], connection org.openhab.habdroid.core.connection.DefaultConnection@95ef6ca
05-26 09:50:53.332 22698 22698 D MainActivity: Got intent: Intent { act=org.openhab.habdroid.action.OH3_UI_SELECTED cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=org.openhab.habdroid.beta/org.openhab.habdroid.ui.MainActivity bnds=[859,1336][1028,1529] }
05-26 09:50:53.334 22698 22698 I wm_on_create_called: [117183046,org.openhab.habdroid.ui.MainActivity,performCreate]
05-26 09:50:53.335 22698 22698 D MainActivity: onStart()
05-26 09:50:53.578 22698 22698 D PageConnectionHolderFragment: onStart(), started false
05-26 09:50:53.589 22698 22698 D ServerConfiguration: load: ServerConfiguration(id=2, name=openhabian, localPath=ServerPath(url=http://<openhab-local-address-openhabian>:8080/, userName=<none>, password=<none>), remotePath=ServerPath(url=https://<openhab-remote-address-openhabian>/, userName=<redacted>, password=<redacted>), sslClientCert=null, defaultSitemap=DefaultSitemap(name=uicomponents_page_8ba312a15d, label=New Sitemap), wifiSsid=null)
05-26 09:50:53.591 22698 22698 D ServerConfiguration: load: ServerConfiguration(id=2, name=openhabian, localPath=ServerPath(url=http://<openhab-local-address-openhabian>:8080/, userName=<none>, password=<none>), remotePath=ServerPath(url=https://<openhab-remote-address-openhabian>/, userName=<redacted>, password=<redacted>), sslClientCert=null, defaultSitemap=DefaultSitemap(name=uicomponents_page_8ba312a15d, label=New Sitemap), wifiSsid=null)
05-26 09:50:53.594 22698 22698 D MainActivity: onActiveConnectionChanged()
05-26 09:50:53.629 22698 22698 D ServerConfiguration: load: ServerConfiguration(id=2, name=openhabian, localPath=ServerPath(url=http://<openhab-local-address-openhabian>:8080/, userName=<none>, password=<none>), remotePath=ServerPath(url=https://<openhab-remote-address-openhabian>/, userName=<redacted>, password=<redacted>), sslClientCert=null, defaultSitemap=DefaultSitemap(name=uicomponents_page_8ba312a15d, label=New Sitemap), wifiSsid=null)
05-26 09:50:53.630 22698 22698 D MainActivity: Cannot auto select server: No server with configured wifi
05-26 09:50:53.630 22698 22698 D PageConnectionHolderFragment: updateActiveConnections: URL list [], connection org.openhab.habdroid.core.connection.DefaultConnection@95ef6ca
05-26 09:50:53.631 22698 22698 I wm_on_start_called: [117183046,org.openhab.habdroid.ui.MainActivity,handleStartActivity]
05-26 09:50:53.631 22698 22698 D MainActivity: onPostCreate()
05-26 09:50:53.632 22698 22698 D MainActivity: onResume()
05-26 09:50:53.658 22698 22698 I wm_on_resume_called: [117183046,org.openhab.habdroid.ui.MainActivity,RESUME_ACTIVITY]
05-26 09:50:53.659 22698 22698 I wm_on_top_resumed_gained_called: [117183046,org.openhab.habdroid.ui.MainActivity,topWhenResuming]
05-26 09:50:53.732 22698 22698 I Choreographer: Skipped 65 frames! The application may be doing too much work on its main thread.
05-26 09:50:53.802 22698 22698 D AbstractWebViewFragment: progressCallback: progress = 10
05-26 09:50:53.803 22698 22698 D AbstractWebViewFragment: progressCallback: progress = 10
05-26 09:50:53.807 22698 22851 D ConnectionFactory: checkAvailableConnection: found types [ConnectionType(type = Wifi, network=111)]
05-26 09:50:53.807 22698 22851 D AbstractConnection: Checking reachability of http://<openhab-local-address-openhabian>:8080/ (via 111)
05-26 09:50:53.811 22698 22698 D AbstractWebViewFragment: progressCallback: progress = 10
05-26 09:50:53.811 22698 22713 I OpenGLRenderer: Davey! duration=1160ms; Flags=1, FrameTimelineVsyncId=1194760, IntendedVsync=58142117760604, Vsync=58143201093894, InputEventId=0, HandleInputStart=58143209781623, AnimationStart=58143209783706, PerformTraversalsStart=58143212094123, DrawStart=58143267114545, FrameDeadline=58142134427270, SyncQueued=58143271186993, SyncStart=58143271583348, IssueDrawCommandsStart=58143271738296, SwapBuffers=58143277080952, FrameCompleted=58143280297359, DequeueBufferDuration=24063, QueueBufferDuration=565313, GpuCompleted=58143280297359, SwapBuffersCompleted=58143278368557, DisplayPresentTime=0,
05-26 09:50:53.811 22698 23430 I okhttp.OkHttpClient: --> GET https://<openhab-remote-address-openhabian>/api/v1/settings/notifications
05-26 09:50:53.811 22698 23430 I okhttp.OkHttpClient: User-Agent: Mozilla/5.0 (Linux; Android 4.0.4; Galaxy Nexus Build/IMM76B) AppleWebKit/535.19 (KHTML, like Gecko) Chrome/18.0.1025.133 Mobile Safari/535.19
05-26 09:50:53.811 22698 23430 I okhttp.OkHttpClient: Cache-Control: no-cache
05-26 09:50:53.811 22698 23430 I okhttp.OkHttpClient: --> END GET
05-26 09:50:53.812 22698 22698 D MainActivity: onCreateOptionsMenu()
05-26 09:50:53.814 22698 22698 D MainActivity: onPrepareOptionsMenu()
05-26 09:50:53.816 22698 22851 D AbstractConnection: Socket connected (attempt 0)
05-26 09:50:53.817 22698 22851 D ConnectionFactory: Connecting to local URL via ConnectionType(type = Wifi, network=111)
05-26 09:50:53.960 22698 22698 D AbstractWebViewFragment: progressCallback: progress = 70
05-26 09:50:53.960 22698 22698 D AbstractWebViewFragment: progressCallback: progress = 70
05-26 09:50:54.239 22698 23430 I okhttp.OkHttpClient: <-- 200 OK https://<openhab-remote-address-openhabian>/api/v1/settings/notifications (427ms)
05-26 09:50:54.239 22698 23430 I okhttp.OkHttpClient: Server: nginx/1.18.0 (Ubuntu)
05-26 09:50:54.239 22698 23430 I okhttp.OkHttpClient: Date: Wed, 26 May 2021 07:50:54 GMT
05-26 09:50:54.239 22698 23430 I okhttp.OkHttpClient: Content-Type: application/json; charset=utf-8
05-26 09:50:54.239 22698 23430 I okhttp.OkHttpClient: Content-Length: 35
05-26 09:50:54.239 22698 23430 I okhttp.OkHttpClient: Connection: keep-alive
05-26 09:50:54.239 22698 23430 I okhttp.OkHttpClient: X-Powered-By: Express
05-26 09:50:54.239 22698 23430 I okhttp.OkHttpClient: ETag: W/"23-/xrOAw4kk/UMX+JDa+0r4GFH8rY"
05-26 09:50:54.239 22698 23430 I okhttp.OkHttpClient: Set-Cookie: ██
05-26 09:50:54.239 22698 23430 I okhttp.OkHttpClient: <-- END HTTP
05-26 09:50:54.241 22698 22698 D MainActivity: onActiveCloudConnectionChanged()
05-26 09:50:54.250 22698 22698 D MainActivity: onPrimaryCloudConnectionChanged()
05-26 09:50:54.344 22698 23013 D FcmRegistrationService: Register device at openHAB-cloud with URL: addAndroidRegistration<redacted>
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:39 (21 by maintainers)
Top Results From Across the Web
android - Don't reload application when orientation changes
My app displays a random image when it first loads and rotating the device should not select another random image. How can I...
Read more >Android screen rotation causes app to reload
If you rorate the screen, the Connect app reloads instead of displaying the page you were on in either landscape or portrait, thus...
Read more >Domain Reloading - Unity - Manual
Domain Reloading resets your scripting state, and is enabled by default. It provides you with a completely fresh scripting state, and resets all...
Read more >Android Studio - Stop Reload on Screen Rotation - YouTube
... Android app development. That is when you will rotate your mobile phone like the portrait to landscape mode, your website will reload....
Read more >Amazon S3 - Cloud Object Storage - AWS
... mobile applications, backup and restore, archival, IoT devices, ML, AI, ... to reduce costs without upfront investment or hardware refresh cycles.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Example Steps:
Expected:
Actual:
I’m not arguing that from a code perspective this is what we should do on activity recreation, my point is this is what is breaking usability, maybe the proper fix should be to figure out why we do activity recreation when you switch to already running app in the background.
I agree these are ugly hacks, this is why we need someone familiar with the project to come up with the correct solution. I would look into why we create a new instance of fragment when you switch into app from background.
This patch avoids the reload of the WebView:
However this breaks the change from one pane to two panes in the sitemaps. Maybe change AbstractWebViewFragment to an activity?