From fbd65127bcb690ab9c7284c010ad224b82f170e7 Mon Sep 17 00:00:00 2001 From: iflyhere <57563846+iflyhere@users.noreply.github.com> Date: Thu, 27 Aug 2026 20:25:46 +0200 Subject: [PATCH] Keep the activity alive across configuration changes VideoActivity declares no android:configChanges, so every configuration change destroys and recreates it. onCreate() re-runs the whole bring-up and onPause()/onStop() tear the link down first, which means a few seconds of black screen and a fresh USB/wfb-ng/decoder init. That fires more often than it looks: - window resize in multi-window / freeform / desktop mode (screenSize, smallestScreenSize, screenLayout) - also how the app is presented on Android XR headsets, where the panel is user resizeable - attaching a keyboard or a dock (keyboard, keyboardHidden, navigation) - rotation (orientation) Handling those in-process is enough: the layout is ConstraintLayout based and re-measures itself, the activity keeps no configuration dependent state, and none of those qualifiers select alternative resources in this project, so no onConfigurationChanged() override is needed. uiMode and density are deliberately not in the list: values-night/ and the mipmap-*dpi buckets do depend on them, so those two still need a recreate to pick up the right resources. Also: - android:resizeableActivity="true" - be explicit rather than relying on the target SDK default - android.hardware.touchscreen android:required="false" - the implicit default is required=true, which marks the app incompatible with any ground station driven by a pointer or a gamepad instead of a touchscreen --- app/src/main/AndroidManifest.xml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index b13e729a..1ad6bc61 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -2,6 +2,11 @@ + + @@ -46,8 +51,10 @@