Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rotate device: App reloads overview-page #2606

Closed
SHU-red opened this issue May 26, 2021 · 40 comments
Closed

Rotate device: App reloads overview-page #2606

SHU-red opened this issue May 26, 2021 · 40 comments
Labels
bug Indicates an unexpected problem or unintended behavior

Comments

@SHU-red
Copy link

SHU-red commented May 26, 2021

Actual 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

  1. Open custom page
  2. 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> 
@SHU-red SHU-red added the bug Indicates an unexpected problem or unintended behavior label May 26, 2021
@mueller-ma
Copy link
Member

Basic UI is used to render sitemaps. The Android app renders them natively, so there's no Basic UI involved.
Do you mean the new UI of openHAB 3?

@SHU-red
Copy link
Author

SHU-red commented May 26, 2021

Basic UI is used to render sitemaps. The Android app renders them natively, so there's no Basic UI involved.
Do you mean the new UI of openHAB 3?

Sorry yes thats what i meant 😅

@mueller-ma
Copy link
Member

Can you visit start page and the subpage in a browser and post both URLs? You can redact everything before the first /.

@SHU-red
Copy link
Author

SHU-red commented May 26, 2021

Yes no problem

  • Did not configure ports or naming
  • Connected via my PC in the local network to my raspberry pi 3+ with openhabian installed
  1. Opening Openhab Web-Interface:
    http://openhabian:8080/#!/

  2. Graph-Page to check PowerConsumption:
    http://openhabian:8080/#!/page/cPowerConsumtpion

@SHU-red
Copy link
Author

SHU-red commented May 26, 2021

In addition:
I checked it for other custom-built pages and always the same:
As soon as i turn my phone, the screen first gets white, i see the loading-bar at the top and then i re-enter on the overview page

@mueller-ma
Copy link
Member

mueller-ma commented May 26, 2021

Can you check the demo mode and open "Positions" there? When I do so and rotate my device, the same page gets loaded again. Maybe there's a change in Android 12.

The tabs on the main page (e,g. "Properties" on https://demo.openhab.org/) won't be restored on device rotation, because the don't change the URL.

@SHU-red
Copy link
Author

SHU-red commented May 26, 2021

No Problem and thanks to your effort.

Also in demo-mode, always the Overview-Page with activated Overview-tab gets loaded.
No matter if i come from another Tab or even change to one of the other pages (Temperatures, Floorplans, Charts, etc.)

Sorry if i cause work for you, just because im using Android 12 already ...

@SHU-red
Copy link
Author

SHU-red commented May 28, 2021

And one more thing that (you sure already know) may help you:

Also when i

  1. Open the app and go to a custom page
  2. Do not rotate the device
  3. Swipe away the app to the background
  4. Open up the app immediately again

As the app opens, i see the custom page opened before for a short moment, but than it also reloads to the overview page

mueller-ma added a commit to mueller-ma/openhab.android that referenced this issue May 31, 2021
See openhab#2606

Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
mueller-ma added a commit to mueller-ma/openhab.android that referenced this issue May 31, 2021
See openhab#2606

Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
@mueller-ma
Copy link
Member

I added some logging around loading webpages: #2611
Let's have a look at your log when #2611 is merged and part of a beta version.

mueller-ma added a commit that referenced this issue May 31, 2021
See #2606

Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
@SHU-red
Copy link
Author

SHU-red commented May 31, 2021

Thank you very much!
Hopefully i will recognize by myself and will post a log asap

@Lzsolo1
Copy link

Lzsolo1 commented May 31, 2021 via email

@mueller-ma
Copy link
Member

You should receive an update to 2.17.5-beta soon.

@SHU-red
Copy link
Author

SHU-red commented Jun 1, 2021

Im not at Home and Had to do it with my Phone
Hopefully ist works

-----------------------
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 crash
05-30 20:02:28.060  5730  5730 E AndroidRuntime: FATAL EXCEPTION: main
05-30 20:02:28.060  5730  5730 E AndroidRuntime: Process: org.openhab.habdroid.beta, PID: 5730
05-30 20:02:28.060  5730  5730 E AndroidRuntime: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.checkStateLoss(FragmentManager.java:1703)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at androidx.fragment.app.FragmentManager.enqueueAction(FragmentManager.java:1743)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at androidx.fragment.app.BackStackRecord.commitInternal(BackStackRecord.java:321)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at androidx.fragment.app.BackStackRecord.commit(BackStackRecord.java:286)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at org.openhab.habdroid.ui.activity.ContentControllerOnePane.executeStateUpdate$mobile_fullBetaRelease(ContentControllerOnePane.kt:50)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at org.openhab.habdroid.ui.activity.ContentController.updateFragmentState(ContentController.kt:497)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at org.openhab.habdroid.ui.activity.ContentController.clearServerCommunicationFailure(ContentController.kt:330)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at org.openhab.habdroid.ui.MainActivity.retryServerPropertyQuery(MainActivity.kt:673)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at org.openhab.habdroid.ui.MainActivity$queryServerProperties$successCb$1$1.invoke(MainActivity.kt:691)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at org.openhab.habdroid.ui.MainActivity$queryServerProperties$successCb$1$1.invoke(MainActivity.kt:690)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at org.openhab.habdroid.ui.MainActivity$scheduleRetry$1.invokeSuspend(MainActivity.kt:517)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at kotlinx.coroutines.DispatchedTaskKt.resume(DispatchedTask.kt:227)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at kotlinx.coroutines.DispatchedTaskKt.dispatch(DispatchedTask.kt:166)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at kotlinx.coroutines.CancellableContinuationImpl.dispatchResume(CancellableContinuationImpl.kt:362)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl(CancellableContinuationImpl.kt:396)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at kotlinx.coroutines.CancellableContinuationImpl.resumeImpl$default(CancellableContinuationImpl.kt:388)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at kotlinx.coroutines.CancellableContinuationImpl.resumeUndispatched(CancellableContinuationImpl.kt:484)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at kotlinx.coroutines.android.HandlerContext$scheduleResumeAfterDelay$$inlined$Runnable$1.run(Runnable.kt:19)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:938)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:99)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at android.os.Looper.loopOnce(Looper.java:201)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:288)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at android.app.ActivityThread.main(ActivityThread.java:7727)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
05-30 20:02:28.060  5730  5730 E AndroidRuntime: 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:975)
--------- beginning of events
06-01 12:50:38.269 16475 16475 I wm_on_restart_called: [200992715,org.openhab.habdroid.ui.MainActivity,performRestartActivity]
06-01 12:50:38.443 16475 16475 I wm_on_start_called: [200992715,org.openhab.habdroid.ui.MainActivity,handleStartActivity]
06-01 12:50:38.453 16475 16475 I wm_on_resume_called: [200992715,org.openhab.habdroid.ui.MainActivity,RESUME_ACTIVITY]
06-01 12:50:38.455 16475 16475 I wm_on_top_resumed_gained_called: [200992715,org.openhab.habdroid.ui.MainActivity,topWhenResuming]
06-01 12:50:39.760 16475 16475 I view_enqueue_input_event: [Motion - Cancel,org.openhab.habdroid.beta/org.openhab.habdroid.ui.MainActivity]
06-01 12:50:40.480 16475 16475 I wm_on_top_resumed_lost_called: [200992715,org.openhab.habdroid.ui.MainActivity,topStateChangedWhenResumed]
06-01 12:50:40.498 16475 16475 I wm_on_paused_called: [200992715,org.openhab.habdroid.ui.MainActivity,performPause]
06-01 12:50:40.596 16475 16475 I wm_on_stop_called: [200992715,org.openhab.habdroid.ui.MainActivity,STOP_ACTIVITY_ITEM]
06-01 18:33:35.412 16475 16475 I wm_on_restart_called: [200992715,org.openhab.habdroid.ui.MainActivity,performRestartActivity]
--------- beginning of main
06-01 18:33:35.433 16475 16475 D MainActivity: onStart()
06-01 18:33:35.449 16475 16475 D PageConnectionHolderFragment: onStart(), started false
06-01 18:33:35.480 16475 16475 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)
06-01 18:33:35.483 16475 16475 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)
06-01 18:33:35.492 16475 16475 D MainActivity: onActiveConnectionChanged()
06-01 18:33:35.495 16475 16475 D AbstractBaseActivity: Hide snackbar with tag connectionEstablished
06-01 18:33:35.500 16475 16475 D ContentController: Indicate no network (message Netzwerk nicht verfügbar)
06-01 18:33:35.500 16475 16475 D PageConnectionHolderFragment: updateActiveConnections: URL list [], connection null
06-01 18:33:35.517 16475 16475 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)
06-01 18:33:35.519 16475 16475 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)
06-01 18:33:35.525 16475 16475 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)
06-01 18:33:35.525 16475 16475 D MainActivity: Cannot auto select server: No server with configured wifi
06-01 18:33:35.525 16475 16475 I wm_on_start_called: [200992715,org.openhab.habdroid.ui.MainActivity,handleStartActivity]
06-01 18:33:35.528 16475 16475 D MainActivity: onNewIntent()
06-01 18:33:35.528 16475 16475 D MainActivity: Got intent: Intent { act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10600000 cmp=org.openhab.habdroid.beta/org.openhab.habdroid.ui.MainActivity bnds=[845,1365][1048,1685] }
06-01 18:33:35.528 16475 16475 D MainActivity: onResume()
06-01 18:33:35.532 16475 16475 I wm_on_resume_called: [200992715,org.openhab.habdroid.ui.MainActivity,RESUME_ACTIVITY]
06-01 18:33:35.534 16475 16475 I wm_on_top_resumed_gained_called: [200992715,org.openhab.habdroid.ui.MainActivity,topStateChangedWhenResumed]
06-01 18:33:35.536 16475 16475 D MainActivity: onCreateOptionsMenu()
06-01 18:33:35.539 16475 16475 D MainActivity: onPrepareOptionsMenu()
06-01 18:33:35.616 16475 16533 D ConnectionFactory: checkAvailableConnection: found types []
06-01 18:33:35.616 16475 16533 E ConnectionFactory: Network is not available
06-01 18:33:35.622 16475 25830 I okhttp.OkHttpClient: --> GET https://<openhab-remote-address-openhabian>/api/v1/settings/notifications
06-01 18:33:35.622 16475 25830 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
06-01 18:33:35.622 16475 25830 I okhttp.OkHttpClient: Cache-Control: no-cache
06-01 18:33:35.622 16475 25830 I okhttp.OkHttpClient: --> END GET
06-01 18:33:35.711 16475 16475 D MainActivity: onActiveConnectionChanged()
06-01 18:33:35.715 16475 16475 D ContentController: Indicate no network (message WLAN ist ausgeschaltet)
06-01 18:33:35.715 16475 16475 D PageConnectionHolderFragment: updateActiveConnections: URL list [], connection null
06-01 18:33:35.720 16475 16475 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)
06-01 18:33:35.723 16475 16475 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)
06-01 18:33:35.734 16475 16475 D MainActivity: onCreateOptionsMenu()
06-01 18:33:35.736 16475 16475 D MainActivity: onPrepareOptionsMenu()
06-01 18:33:41.094 16475 25830 I okhttp.OkHttpClient: <-- 200 OK https://<openhab-remote-address-openhabian>/api/v1/settings/notifications (5471ms)
06-01 18:33:41.094 16475 25830 I okhttp.OkHttpClient: Server: nginx/1.18.0 (Ubuntu)
06-01 18:33:41.094 16475 25830 I okhttp.OkHttpClient: Date: Tue, 01 Jun 2021 16:33:41 GMT
06-01 18:33:41.094 16475 25830 I okhttp.OkHttpClient: Content-Type: application/json; charset=utf-8
06-01 18:33:41.094 16475 25830 I okhttp.OkHttpClient: Content-Length: 35
06-01 18:33:41.094 16475 25830 I okhttp.OkHttpClient: Connection: keep-alive
06-01 18:33:41.094 16475 25830 I okhttp.OkHttpClient: X-Powered-By: Express
06-01 18:33:41.094 16475 25830 I okhttp.OkHttpClient: ETag: W/"23-/xrOAw4kk/UMX+JDa+0r4GFH8rY"
06-01 18:33:41.094 16475 25830 I okhttp.OkHttpClient: Set-Cookie: ██
06-01 18:33:41.094 16475 25830 I okhttp.OkHttpClient: <-- END HTTP
06-01 18:33:41.100 16475 16475 D MainActivity: onActiveConnectionChanged()
06-01 18:33:41.104 16475 16475 D ContentController: Indicate no network (message WLAN ist ausgeschaltet)
06-01 18:33:41.104 16475 16475 D PageConnectionHolderFragment: updateActiveConnections: URL list [], connection null
06-01 18:33:41.110 16475 16475 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)
06-01 18:33:41.115 16475 16475 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)
06-01 18:33:41.117 16475 16475 D MainActivity: onActiveCloudConnectionChanged()
06-01 18:33:41.122 16475 16475 D MainActivity: onPrimaryCloudConnectionChanged()
06-01 18:33:41.123 16475 16475 D MainActivity: onCreateOptionsMenu()
06-01 18:33:41.125 16475 16475 D MainActivity: onPrepareOptionsMenu()
06-01 18:33:41.145 16475 16544 D FcmRegistrationService: Register device at openHAB-cloud with URL: addAndroidRegistration<redacted>

@mueller-ma
Copy link
Member

The log doesn't contain the information I need. Can you disable debug logging in the app, clear the log and reproduce the issue?

@SHU-red
Copy link
Author

SHU-red commented Jun 2, 2021

No Problem

-----------------------
Device information
Model: Pixel 3a
Manufacturer: Google
Brand: google
Device: sargo
Product: sargo
OS: 11
Display: 2220x1036, 2.3375 density
Data usage policy: DataUsagePolicy(canDoLargeTransfers=true, loadIconsWithState=true, autoPlayVideos=true, canDoRefreshes=true), data saver: 1, battery saver: false
-----------------------

--------- beginning of events
06-02 08:44:45.931 25538 25538 I view_enqueue_input_event: [Motion - Cancel,org.openhab.habdroid.beta/org.openhab.habdroid.ui.LogActivity]
06-02 08:44:46.056 25538 25538 I wm_on_top_resumed_lost_called: [107681131,org.openhab.habdroid.ui.LogActivity,topStateChangedWhenResumed]
06-02 08:44:46.057 25538 25538 I wm_on_paused_called: [107681131,org.openhab.habdroid.ui.LogActivity,performPause]
06-02 08:44:46.076 25538 25538 I wm_on_destroy_called: [116690556,org.openhab.habdroid.ui.PreferencesActivity,performDestroy]
--------- beginning of main
06-02 08:44:46.128 25538 25538 D Ringtone: Successfully created local player
06-02 08:44:46.137 25538 25538 D PreferencesActivity: Removing notification prefs for < 25
06-02 08:44:46.145 25538 25538 I wm_on_create_called: [116690556,org.openhab.habdroid.ui.PreferencesActivity,performCreate]
06-02 08:44:46.152 25538 25538 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)
06-02 08:44:46.154 25538 25538 I wm_on_start_called: [116690556,org.openhab.habdroid.ui.PreferencesActivity,handleStartActivity]
06-02 08:44:46.155 25538 25538 I wm_on_resume_called: [116690556,org.openhab.habdroid.ui.PreferencesActivity,RESUME_ACTIVITY]
06-02 08:44:46.155 25538 25538 I wm_on_top_resumed_gained_called: [116690556,org.openhab.habdroid.ui.PreferencesActivity,topWhenResuming]
06-02 08:44:46.224 25538 25538 W ListPreference: Setting a summary with a String formatting marker is no longer supported. You should use a SummaryProvider instead.
06-02 08:44:46.257 25538 25538 W ListPreference: Setting a summary with a String formatting marker is no longer supported. You should use a SummaryProvider instead.
06-02 08:44:46.660 25538 25538 I wm_on_stop_called: [107681131,org.openhab.habdroid.ui.LogActivity,LIFECYCLER_STOP_ACTIVITY]
06-02 08:44:46.661 25538 25538 I wm_on_destroy_called: [107681131,org.openhab.habdroid.ui.LogActivity,performDestroy]
06-02 08:44:47.099 25538 25538 I view_enqueue_input_event: [Motion - Cancel,org.openhab.habdroid.beta/org.openhab.habdroid.ui.PreferencesActivity]
06-02 08:44:47.207 25538 25538 I wm_on_top_resumed_lost_called: [116690556,org.openhab.habdroid.ui.PreferencesActivity,topStateChangedWhenResumed]
06-02 08:44:47.207 25538 25538 I wm_on_paused_called: [116690556,org.openhab.habdroid.ui.PreferencesActivity,performPause]
06-02 08:44:47.217 25538 25538 I wm_on_destroy_called: [78951644,org.openhab.habdroid.ui.MainActivity,performDestroy]
06-02 08:44:47.229 25538 25538 D MainActivity: onCreate()
06-02 08:44:47.243 25538 25538 D ContentController: onRestoreInstanceState()
06-02 08:44:47.243 25538 25538 D PageConnectionHolderFragment: updateActiveConnections: URL list [], connection org.openhab.habdroid.core.connection.DefaultConnection@8e4ed92
06-02 08:44:47.246 25538 25538 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=[845,1365][1048,1685] }
06-02 08:44:47.248 25538 25538 I wm_on_create_called: [78951644,org.openhab.habdroid.ui.MainActivity,performCreate]
06-02 08:44:47.249 25538 25538 D MainActivity: onStart()
06-02 08:44:47.255 25538 25538 D PageConnectionHolderFragment: onStart(), started false
06-02 08:44:47.257 25538 25538 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)
06-02 08:44:47.258 25538 25538 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)
06-02 08:44:47.262 25538 25538 D MainActivity: onActiveConnectionChanged()
06-02 08:44:47.273 25538 25538 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)
06-02 08:44:47.274 25538 25538 D MainActivity: Cannot auto select server: No server with configured wifi
06-02 08:44:47.274 25538 25538 D PageConnectionHolderFragment: updateActiveConnections: URL list [], connection org.openhab.habdroid.core.connection.DefaultConnection@8e4ed92
06-02 08:44:47.274 25538 25538 I wm_on_start_called: [78951644,org.openhab.habdroid.ui.MainActivity,handleStartActivity]
06-02 08:44:47.274 25538 25538 D MainActivity: onPostCreate()
06-02 08:44:47.277 25538 25538 D MainActivity: onActivityResult() requestCode = 1001, resultCode = -1
06-02 08:44:47.277 25538 25538 I wm_on_activity_result_called: [78951644,org.openhab.habdroid.ui.MainActivity,RESUME_ACTIVITY]
06-02 08:44:47.277 25538 25538 D MainActivity: onResume()
06-02 08:44:47.328 25538 25538 D AbstractWebViewFragment: Load default website
06-02 08:44:47.356 25538 25538 I wm_on_resume_called: [78951644,org.openhab.habdroid.ui.MainActivity,RESUME_ACTIVITY]
06-02 08:44:47.364 25538 25538 I wm_on_top_resumed_gained_called: [78951644,org.openhab.habdroid.ui.MainActivity,topStateChangedWhenResumed]
06-02 08:44:47.414 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 10
06-02 08:44:47.418 25538 25538 D MainActivity: onCreateOptionsMenu()
06-02 08:44:47.419 25538 25538 D MainActivity: onPrepareOptionsMenu()
06-02 08:44:47.559 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 20
06-02 08:44:47.649 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 70
06-02 08:44:47.767 25538 25657 D OHAppInterface: goFullscreen()
06-02 08:44:47.809 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 100
06-02 08:44:47.810 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 100
06-02 08:44:47.847 25538 25538 I wm_on_stop_called: [116690556,org.openhab.habdroid.ui.PreferencesActivity,LIFECYCLER_STOP_ACTIVITY]
06-02 08:44:47.850 25538 25538 I wm_on_destroy_called: [116690556,org.openhab.habdroid.ui.PreferencesActivity,performDestroy]
06-02 08:44:48.371 25538 25657 D OHAppInterface: preferDarkMode(): dark
06-02 08:44:48.395 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 10
06-02 08:44:48.396 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 100
06-02 08:44:51.064 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 10
06-02 08:44:51.065 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 100
06-02 08:44:51.161 25538 25538 E AbstractWebViewFragment: onReceivedError() on URL: https://home.<openhab-remote-address-openhabian>/rest/events/states
06-02 08:44:53.238 25538 25538 I wm_on_top_resumed_lost_called: [78951644,org.openhab.habdroid.ui.MainActivity,pausing]
06-02 08:44:53.239 25538 25538 D MainActivity: onPause()
06-02 08:44:53.243 25538 25538 I wm_on_paused_called: [78951644,org.openhab.habdroid.ui.MainActivity,performPause]
06-02 08:44:53.254 25538 25538 D MainActivity: onStop()
06-02 08:44:53.254 25538 25538 D PageConnectionHolderFragment: onStop()
06-02 08:44:53.254 25538 25538 I wm_on_stop_called: [78951644,org.openhab.habdroid.ui.MainActivity,handleRelaunchActivity]
06-02 08:44:53.254 25538 25538 D MainActivity: onSaveInstanceState()
06-02 08:44:53.254 25538 25538 D ContentController: onSaveInstanceState()
06-02 08:44:53.273 25538 25538 I wm_on_destroy_called: [78951644,org.openhab.habdroid.ui.MainActivity,performDestroy]
06-02 08:44:53.311 25538 25538 D MainActivity: onCreate()
06-02 08:44:53.330 25538 25538 D ContentController: onRestoreInstanceState()
06-02 08:44:53.330 25538 25538 D PageConnectionHolderFragment: updateActiveConnections: URL list [], connection org.openhab.habdroid.core.connection.DefaultConnection@8e4ed92
06-02 08:44:53.330 25538 25538 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=[845,1365][1048,1685] }
06-02 08:44:53.332 25538 25538 I wm_on_create_called: [78951644,org.openhab.habdroid.ui.MainActivity,performCreate]
06-02 08:44:53.332 25538 25538 D MainActivity: onStart()
06-02 08:44:53.345 25538 25538 D AbstractWebViewFragment: Load website from savedInstanceState: https://home.<openhab-remote-address-openhabian>/page/schlafzimmer
06-02 08:44:53.355 25538 25538 D PageConnectionHolderFragment: onStart(), started true
06-02 08:44:53.357 25538 25538 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)
06-02 08:44:53.359 25538 25538 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)
06-02 08:44:53.361 25538 25538 D MainActivity: onActiveConnectionChanged()
06-02 08:44:53.369 25538 25538 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)
06-02 08:44:53.369 25538 25538 D MainActivity: Cannot auto select server: No server with configured wifi
06-02 08:44:53.370 25538 25538 D PageConnectionHolderFragment: updateActiveConnections: URL list [], connection org.openhab.habdroid.core.connection.DefaultConnection@8e4ed92
06-02 08:44:53.370 25538 25538 I wm_on_start_called: [78951644,org.openhab.habdroid.ui.MainActivity,handleStartActivity]
06-02 08:44:53.371 25538 25538 W PhoneWindow: Previously focused view reported id 2131362480 during save, but can't be found during restore.
06-02 08:44:53.371 25538 25538 D MainActivity: onPostCreate()
06-02 08:44:53.372 25538 25538 D MainActivity: onResume()
06-02 08:44:53.380 25538 25538 D AbstractWebViewFragment: Load default website
06-02 08:44:53.390 25538 25538 I wm_on_resume_called: [78951644,org.openhab.habdroid.ui.MainActivity,RESUME_ACTIVITY]
06-02 08:44:53.390 25538 25538 I wm_on_top_resumed_gained_called: [78951644,org.openhab.habdroid.ui.MainActivity,topWhenResuming]
06-02 08:44:53.471 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 10
06-02 08:44:53.473 25538 25538 D MainActivity: onCreateOptionsMenu()
06-02 08:44:53.474 25538 25538 D MainActivity: onPrepareOptionsMenu()
06-02 08:44:53.544 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 20
06-02 08:44:53.641 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 70
06-02 08:44:53.726 25538 25657 D OHAppInterface: goFullscreen()
06-02 08:44:53.743 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 100
06-02 08:44:53.744 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 100
06-02 08:44:54.311 25538 25657 D OHAppInterface: preferDarkMode(): dark
06-02 08:44:54.326 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 10
06-02 08:44:54.344 25538 25538 D AbstractWebViewFragment: progressCallback: progress = 100
06-02 08:44:56.970 25538 25657 D OHAppInterface: exitToApp()
06-02 08:44:56.981 25538 25538 D PageConnectionHolderFragment: updateActiveConnections: URL list [], connection org.openhab.habdroid.core.connection.DefaultConnection@8e4ed92
06-02 08:44:56.997 25538 25538 D MainActivity: onCreateOptionsMenu()
06-02 08:44:56.997 25538 25538 D MainActivity: onPrepareOptionsMenu()
06-02 08:44:57.998 25538 25538 D MainActivity: onOptionsItemSelected()
06-02 08:44:58.737 25538 25538 D ServerProperties: Server returned sitemaps: []
06-02 08:44:58.806 25538 25548 W System  : A resource failed to call release. 
06-02 08:44:58.807 25538 25548 W System  : A resource failed to call release. 
06-02 08:44:58.807 25538 25548 W System  : A resource failed to call release. 
06-02 08:44:58.810 25538 25548 V MediaPlayer: resetDrmState:  mDrmInfo=null mDrmProvisioningThread=null mPrepareDrmInProgress=false mActiveDrmScheme=false
06-02 08:44:58.810 25538 25548 V MediaPlayer: cleanDrmObj: mDrmObj=null mDrmSessionId=null
06-02 08:44:58.979 25538 25538 I wm_on_top_resumed_lost_called: [78951644,org.openhab.habdroid.ui.MainActivity,topStateChangedWhenResumed]
06-02 08:44:58.980 25538 25538 D MainActivity: onPause()
06-02 08:44:58.981 25538 25538 I wm_on_paused_called: [78951644,org.openhab.habdroid.ui.MainActivity,performPause]
06-02 08:44:59.009 25538 25538 I wm_on_create_called: [32600784,org.openhab.habdroid.ui.PreferencesActivity,performCreate]
06-02 08:44:59.031 25538 25538 D Ringtone: Successfully created local player
06-02 08:44:59.038 25538 25538 D PreferencesActivity: Removing notification prefs for < 25
06-02 08:44:59.043 25538 25538 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)
06-02 08:44:59.044 25538 25538 I wm_on_start_called: [32600784,org.openhab.habdroid.ui.PreferencesActivity,handleStartActivity]
06-02 08:44:59.045 25538 25538 I wm_on_resume_called: [32600784,org.openhab.habdroid.ui.PreferencesActivity,RESUME_ACTIVITY]
06-02 08:44:59.050 25538 25538 I wm_on_top_resumed_gained_called: [32600784,org.openhab.habdroid.ui.PreferencesActivity,topStateChangedWhenResumed]
06-02 08:44:59.519 25538 25575 D OpenGLRenderer: endAllActiveAnimators on 0x723e173530 (NavigationMenuItemView) with handle 0x714e0dc030
06-02 08:44:59.530 25538 25538 D MainActivity: onStop()
06-02 08:44:59.530 25538 25538 D PageConnectionHolderFragment: onStop()
06-02 08:44:59.530 25538 25538 I wm_on_stop_called: [78951644,org.openhab.habdroid.ui.MainActivity,STOP_ACTIVITY_ITEM]
06-02 08:44:59.530 25538 25538 D MainActivity: onSaveInstanceState()
06-02 08:44:59.530 25538 25538 D ContentController: onSaveInstanceState()
06-02 08:44:59.840 25538 25538 W ListPreference: Setting a summary with a String formatting marker is no longer supported. You should use a SummaryProvider instead.
06-02 08:44:59.853 25538 25538 W ListPreference: Setting a summary with a String formatting marker is no longer supported. You should use a SummaryProvider instead.
06-02 08:45:00.854 25538 25538 I wm_on_top_resumed_lost_called: [32600784,org.openhab.habdroid.ui.PreferencesActivity,topStateChangedWhenResumed]
06-02 08:45:00.854 25538 25538 I wm_on_paused_called: [32600784,org.openhab.habdroid.ui.PreferencesActivity,performPause]
06-02 08:45:00.879 25538 25538 I wm_on_create_called: [170468979,org.openhab.habdroid.ui.LogActivity,performCreate]
06-02 08:45:00.879 25538 25538 I wm_on_start_called: [170468979,org.openhab.habdroid.ui.LogActivity,handleStartActivity]
06-02 08:45:00.880 25538 25538 I wm_on_resume_called: [170468979,org.openhab.habdroid.ui.LogActivity,RESUME_ACTIVITY]
06-02 08:45:00.886 25538 25538 I wm_on_top_resumed_gained_called: [170468979,org.openhab.habdroid.ui.LogActivity,topStateChangedWhenResumed]
06-02 08:45:00.911 25538 25538 D LogActivity: onCreateOptionsMenu()

@mueller-ma
Copy link
Member

That looks better. I'll investigate this later.

@SHU-red
Copy link
Author

SHU-red commented Jun 2, 2021

That looks better. I'll investigate this later.

Thank you again very much

@mueller-ma
Copy link
Member

06-02 08:44:53.345 25538 25538 D AbstractWebViewFragment: Load website from savedInstanceState: https://home.<openhab-remote-address-openhabian>/page/schlafzimmer
[...]
06-02 08:44:53.380 25538 25538 D AbstractWebViewFragment: Load default website

The app loads the previous page, but short after that the webview fragment is created again and therefore loads the default start page. I'm not sure why this happens, but it might be related to Android 12.

@SHU-red
Copy link
Author

SHU-red commented Jun 2, 2021

Thank you very much for your investigation!

So maybe

  • its a change in general to Android 12
  • its a bug due to the fact, that its a beta OS at the moment

If i can support im some way, then just tell me

@SHU-red
Copy link
Author

SHU-red commented Jun 9, 2021

Update:
Just received Android 12 Beta 2

Still the same behaviour

@SHU-red
Copy link
Author

SHU-red commented Jul 14, 2021

Android 12 beta 3 is here

Still same behaviour

@mstormi
Copy link
Contributor

mstormi commented Jul 23, 2021

I have been seeing the UI reload on rotate ever, too. On Android 11, currently 2.18.0.

@maniac103
Copy link
Contributor

The reload is not a/the problem ... the problem is jumping to the overview page in the reload process.

@mstormi
Copy link
Contributor

mstormi commented Jul 27, 2021

The reload is not a/the problem ... the problem is jumping to the overview page in the reload process.

That jump back problem I'm having, too.
But a reload (all by itself) I'd consider wrong as well as the page didn't change and reloading can take significant time depending on network hence affect UX.

mueller-ma added a commit to mueller-ma/openhab.android that referenced this issue Aug 1, 2021
I'm not sure if there are any side effects of this in the Sitemaps. Maybe change AbstractWebViewFragment to an activity?

Fixes openhab#2606

Signed-off-by: mueller-ma <mueller-ma@users.noreply.github.com>
@mueller-ma
Copy link
Member

This patch avoids the reload of the WebView:

diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml
index f2a01884..0b327bb5 100644
--- a/mobile/src/main/AndroidManifest.xml
+++ b/mobile/src/main/AndroidManifest.xml
@@ -81,6 +81,7 @@
             android:label="@string/widget_type_image" />
         <activity
             android:name=".ui.MainActivity"
+            android:configChanges="orientation|screenSize"
             android:label="@string/app_name"
             android:launchMode="singleTop">

However this breaks the change from one pane to two panes in the sitemaps. Maybe change AbstractWebViewFragment to an activity?

@maniac103
Copy link
Contributor

Removing this line (or rather: avoiding the loadUrl call in that case) probably has the same effect, doesn't it?

The configChanges thing is a hack that should only be used in very specific circumstances. See the 'caution' box in the docs.

@mueller-ma
Copy link
Member

avoiding the loadUrl call in that case

This would lead to an empty WebView as restoreState: "Please note that this method no longer restores the display data for this WebView." https://developer.android.com/reference/android/webkit/WebView#restoreState(android.os.Bundle)

@ramack
Copy link

ramack commented Jan 2, 2022

I also suffer from jumps to the default overview page by rotation and think I have even seen it while switching network connections (mobile <->WLAN but also changing accesspoints) earlier - but I cannot reproduce it right now, maybe this part is already fixed in the meantime. What is definitly still an issue in those situations is the reload itself, as it takes quite some time.

The best would be in my eyes, if the HTML is even cached on the devices locally totally for all sitemaps until they page is modified in openHAB (or a manual refresh in the app is triggered) and only the data of the shown items is reloaded - which is also done during normal operation.

Edit: Forgot to mention: I am on Android 10, server: openHAB 3.2.0 and android app openHAB 2.19.10-beta from fdroid.

@pawel-sw
Copy link

I'm facing the same problem the UI is reloaded both on rotate and on restore.

mueller-ma Your patch only fixed reload on rotate, it didn't fix reload on restore (when app is reopened while running in background)
maniac103 This didn't change anything, as the fragment was always recreated and savedInstanceState was always null.

I traced the problem to be related to the WebUI fragment being recreated every time.
Appling a hack that checks temporaryPage is null in org.openhab.habdroid.ui.activity.ContentController#showWebViewUi did fixed reloads on app restore, it prevents the fragment from ever be recreated.
I didn't investigate why this method is called on restore I'll leave it to people familiar with the project, to help this is a stack trace that calls this method on restore:

showWebViewUi:267, ContentController (org.openhab.habdroid.ui.activity)
openWebViewUi:1176, MainActivity (org.openhab.habdroid.ui)
access$openWebViewUi:135, MainActivity (org.openhab.habdroid.ui)
invoke:1078, MainActivity$executeActionIfPossible$2 (org.openhab.habdroid.ui)
invoke:1078, MainActivity$executeActionIfPossible$2 (org.openhab.habdroid.ui)
executeActionForServer:1116, MainActivity (org.openhab.habdroid.ui)
executeActionIfPossible:1078, MainActivity (org.openhab.habdroid.ui)
executeOrStoreAction:1056, MainActivity (org.openhab.habdroid.ui)
processIntent:772, MainActivity (org.openhab.habdroid.ui)
onNewIntent:183, MainActivity (org.openhab.habdroid.ui)
performNewIntent:8306, Activity (android.app)
callActivityOnNewIntent:1429, Instrumentation (android.app)
callActivityOnNewIntent:1442, Instrumentation (android.app)
deliverNewIntents:4241, ActivityThread (android.app)
handleNewIntent:4248, ActivityThread (android.app)
execute:56, NewIntentItem (android.app.servertransaction)
execute:45, ActivityTransactionItem (android.app.servertransaction)
executeCallbacks:135, TransactionExecutor (android.app.servertransaction)
execute:95, TransactionExecutor (android.app.servertransaction)
handleMessage:2438, ActivityThread$H (android.app)
dispatchMessage:106, Handler (android.os)
loopOnce:226, Looper (android.os)
loop:313, Looper (android.os)
main:8663, ActivityThread (android.app)
invoke:-1, Method (java.lang.reflect)
run:567, RuntimeInit$MethodAndArgsCaller (com.android.internal.os)
main:1135, ZygoteInit (com.android.internal.os)

The full patch including mueller-ma changes it fixes all reloads for me:

Index: mobile/src/main/java/org/openhab/habdroid/ui/activity/ContentController.kt
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/mobile/src/main/java/org/openhab/habdroid/ui/activity/ContentController.kt b/mobile/src/main/java/org/openhab/habdroid/ui/activity/ContentController.kt
--- a/mobile/src/main/java/org/openhab/habdroid/ui/activity/ContentController.kt	(revision 6be8232ad56385dee827f6a6feb581ad2404bfec)
+++ b/mobile/src/main/java/org/openhab/habdroid/ui/activity/ContentController.kt	(date 1653768352713)
@@ -264,13 +264,15 @@
     }
 
     fun showWebViewUi(ui: WebViewUi, isStackRoot: Boolean, subpage: String?) {
-        val webViewFragment = ui.fragment.newInstance()
-        webViewFragment.arguments = bundleOf(
-            KEY_IS_STACK_ROOT to isStackRoot,
-            KEY_SUBPAGE to subpage
-        )
-        webViewFragment.setCallback(this)
-        showTemporaryPage(webViewFragment)
+        if (temporaryPage == null) {
+            val webViewFragment = ui.fragment.newInstance()
+            webViewFragment.arguments = bundleOf(
+                KEY_IS_STACK_ROOT to isStackRoot,
+                KEY_SUBPAGE to subpage
+            )
+            webViewFragment.setCallback(this)
+            showTemporaryPage(webViewFragment)
+        }
     }
 
     /**
Index: mobile/src/main/AndroidManifest.xml
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/mobile/src/main/AndroidManifest.xml b/mobile/src/main/AndroidManifest.xml
--- a/mobile/src/main/AndroidManifest.xml	(revision 6be8232ad56385dee827f6a6feb581ad2404bfec)
+++ b/mobile/src/main/AndroidManifest.xml	(date 1653768741323)
@@ -87,6 +87,7 @@
             android:exported="false" />
         <activity
             android:name=".ui.MainActivity"
+            android:configChanges="orientation|screenSize"
             android:label="@string/app_name"
             android:launchMode="singleTop"
             android:exported="true">

Some other unrelated things that I noticed that may potentially cause problems in future with the state saving:

  • AbstractWebViewFragment has no id
  • org.openhab.habdroid.ui.activity.AbstractWebViewFragment#onSaveInstanceState is not calling super.onSaveInstanceState(outState)

@maniac103
Copy link
Contributor

maniac103 This didn't change anything, as the fragment was always recreated and savedInstanceState was always null.

'This' being what exactly?

I traced the problem to be related to the WebUI fragment being recreated every time.

The fragment being recreated on activity recreation is expected behavior. Or what exactly does 'every time' mean? The stack trace makes it look like the app was opened by a shortcut to OH3 UI?

The full patch including mueller-ma changes it fixes all reloads for me:

Which unfortunately is a combination of two ugly hacks. Maybe the check for the existence of temporaryPage isn't a bad idea, but when doing that one needs to check whether the temporary page has the same parameters and type as the expected new page.
I mentioned the docs for the config changes thing earlier already...

@pawel-sw
Copy link

pawel-sw commented May 28, 2022

'This' being what exactly?

Removing this line (or rather: avoiding the loadUrl call in that case) probably has the same effect, doesn't it?

The fragment being recreated on activity recreation is expected behavior. Or what exactly does 'every time' mean? The stack trace makes it look like the app was opened by a shortcut to OH3 UI?

Example Steps:

  1. Open OH app navigate to Location->Garage->Properties->Garage Opener to open the door
  2. Go to the Android home screen or switch to other app to do other stuff
  3. Open OH app again from the homescreen or use app switcher

Expected:

  • The app is brought up from the background as is (with the state that was left so I can quickly close the garage door).

Actual:

  • The entire app reloads not only losing any progress but also taking a long time to load outside a home on a weak WiFi connection.
    I can't think why that would be expected behavior as now I need to wait 3-5 seconds for the app to load and navigate again Location->Garage->Properties->Garage Opener to close the door that was just opened using this app.

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.

Which unfortunately is a combination of two ugly hacks.

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.

@berni2288
Copy link

It seems in the current beta version of the app, the behavior has been improved. Rotation refreshes the page, but does not change the page anymore.
Also when having the app in the background and bringing it back to the foreground with the app drawer icon, it does not reload anymore!
That's very good news for my wall mounted tablet, as the refresh always took annoying 5 seconds.

@mueller-ma
Copy link
Member

Instead of trying to improve our fullscreen webview, we could switch to custom tabs. I started on this and was able to fix this issue: https://github.com/mueller-ma/openhab.android/commits/custom-tabs (Needs some rework of existing classes).

Also see https://developer.chrome.com/docs/android/custom-tabs/integration-guide/

@maniac103
Copy link
Contributor

we could switch to custom tabs

While I generally think this is a good idea, there's two possible caveats here:

  • people who set e.g. the OH3 UI as their main page will probably expect the OH3 UI to be displayed within MainActivity (which means e.g. closing on back button instead of dropping back to another empty activity etc.)
  • since custom tabs run within the Chrome process (I think), I'm not sure our solution to bind to Wifi even if it doesn't have internet connection (Bind local connections to their respective networks #1769) will work with that

@SHU-red
Copy link
Author

SHU-red commented Dec 13, 2022

... the behavior has been improved. Rotation refreshes the page, but does not change the page anymore.

I currently tested it and after a device rotation, im getting thrown back to the Overview pate again

... we could switch to custom tabs

While I generally think this is a good idea ...

Im not sure if this is related to the topic here?
But im not sure i did understand how custom tabs are related to reloading the page after device rotation

@maniac103
Copy link
Contributor

But im not sure i did understand how custom tabs are related to reloading the page after device rotation

The idea is to show all web pages (OH3 main UI, HabPanel etc.) in custom tabs.

@mueller-ma
Copy link
Member

  • people who set e.g. the OH3 UI as their main page will probably expect the OH3 UI to be displayed within MainActivity (which means e.g. closing on back button instead of dropping back to another empty activity etc.)

We could move all the sitemap code to a new activity SitemapActivity. MainActivity would be responsible for opening other activities/custom tabs based on settings or intents from shortcuts.

Custom tabs can be run by many browsers: "Custom Tabs is supported by most Android browsers." (from https://developer.chrome.com/docs/android/custom-tabs/integration-guide/#what-happens-if-the-user-doesnt-have-a-browser-that-supports-custom-tabs-installed)
Most likely the connection won't work if wifi is connected, but has no internet connection. Maybe accept this as a shortcoming? I'd add a preference anyway to let the user decide between built-in webview and custom tabs.

But im not sure i did understand how custom tabs are related to reloading the page after device rotation

With custom tabs we can use browsers to display the UIs that are based on websites (vs sitemaps that are based on a JSON API). These browsers have been built with more developer resources so issues like this, #3048, #2974, #2819 and maybe some more should be fixed.

@maniac103
Copy link
Contributor

We could move all the sitemap code to a new activity SitemapActivity. MainActivity would be responsible for opening other activities/custom tabs based on settings or intents from shortcuts.

And how would one access e.g. the preferences in that kind of setup? If you now say 'via SitemapActivity', you have just given MainActivity a new name. If you say 'via MainActivity', how does one get there and what is its content?
We should first think of how the user is supposed to use the app, and derive the activity stack from that, not the other way around.

Most likely the connection won't work if wifi is connected, but has no internet connection. Maybe accept this as a shortcoming?

Isn't that kind of helpers exactly what distinguishes the dedicated app from a browser? IOW, what's the advantage of using the app instead of the browser in the proposed setup?

These browsers have been built with more developer resources so issues like this, #3048, #2974, #2819 and maybe some more should be fixed.

I'd rather look at it from a different angle: maybe we just have to accept that a WebView is not a fully fledged browser, and rather check whether main UI can help us, e.g. by consistently reflecting navigation in the URL?

Nevertheless, introducing custom tabs is a good idea, but IMHO only for opening content that currently is redirected to a browser.

@mueller-ma
Copy link
Member

And how would one access e.g. the preferences in that kind of setup?

I didn't think at that.

Isn't that kind of helpers exactly what distinguishes the dedicated app from a browser?

Good point 👍

I'd rather look at it from a different angle: maybe we just have to accept that a WebView is not a fully fledged browser, and rather check whether main UI can help us, e.g. by consistently reflecting navigation in the URL?

I think the issue here is that the WebView reloads at all: The content disappears for a short moment and e.g. the scroll position is lost.
If this is in a new activity, it could add android:configChanges="orientation|screenSize" to disable the automatic activity recreation and thus the reload.

@mueller-ma
Copy link
Member

and rather check whether main UI can help us, e.g. by consistently reflecting navigation in the URL?

This seems to be the case: Switching tabs in Main UI also changes the URL now, so the Android app reloads exactly this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior
Projects
None yet
Development

No branches or pull requests

8 participants