AI-powered crash analysis is now available on all plans — including Free.Read the crash analysis guide

Mobile Multi-Window & Foldable Crash Debugging

NFNourin Mahfuj Finick··4 min read

Foldables and multi-window layouts broke a core assumption most mobile apps still make: that the window an app runs in has one fixed size and aspect ratio for the life of the process. On a folding phone, or in Android split-screen, or under iOS Stage Manager, that window can resize, reflow, and even change orientation multiple times without the app ever leaving the foreground — and a surprising amount of crash-prone code has never been exercised that way before.

Why these crashes are different from a normal rotation bug

A single-window app usually only deals with orientation changes — portrait to landscape, handled once by onConfigurationChanged or an iOS trait collection update. Foldables and multi-window stack several new triggers on top of that:

  • Fold/unfold posture changes — the same activity instance stays alive but its available size jumps (e.g. a Galaxy Fold's cover screen to its main 7.6" display) mid-session, not just at launch.
  • Split-screen resize drags — the user can drag the divider continuously, firing a burst of configuration changes in a short window rather than one clean transition.
  • Multi-instance and multi-resume — more than one window of the same app can be active at once on large-screen Android and iPadOS/Stage Manager, which breaks any code that assumes a single Activity/ViewController instance or global mutable state.

Code that reads Activity.isInMultiWindowMode() or a screen size once at onCreate and caches it is a common source of crashes: it works perfectly in every manual test (which usually never folds or resizes the app) and then breaks the moment a real foldable user unfolds their device mid-session.

Common crash patterns

Config-change crash loops. If a fold/unfold event isn't declared in android:configChanges, the Activity is destroyed and recreated — and if onSaveInstanceState/onRestoreInstanceState don't round-trip cleanly, you get a crash or corrupted state on every single fold, not just the first one.

WindowManager listener leaks. Jetpack's WindowInfoTracker (via WindowManager) is the supported way to observe fold posture, hinge position, and window size class. Registering a listener in onCreate without unregistering it in onDestroy — or trying to register it against a stale Activity reference after a config-change recreation — is a frequent source of leaked-window and IllegalStateException crashes on foldables specifically, because the listener fires far more often than on a fixed-size device.

Layout math that assumes a minimum width. Split-screen and cover-screen layouts can push an app's available width well below what phone UIs are normally tested at. Fixed-width components, hardcoded padding math, or divide-by-zero assumptions about "half the screen" layouts show up as crashes (not just visual bugs) when a RecyclerView or LazyColumn tries to lay out negative or zero-width items.

iOS Stage Manager resume issues. Apps that assume UIScreen.main.bounds is authoritative for their window size can crash or render invalid layouts under Stage Manager, where an app's window is smaller than the physical screen and can be resized independently by the user.

Testing without owning every foldable on the market

You don't need a physical device farm to catch most of this. Android Studio's Resizable Emulator and the Wear/Foldable AVD configurations let you simulate fold, unfold, and split-screen transitions and drive rapid resize events that are hard to reproduce by hand. On iOS, the Simulator supports Stage Manager and multiple window sizes on iPad targets. The goal in both cases isn't full device coverage — it's forcing the rapid, repeated configuration churn that real foldable and multi-window usage produces, since that's what exposes listener leaks and stale-state bugs that a single manual rotation test won't catch.

Catching what testing misses

Emulator testing catches the obvious cases, but posture and multi-window bugs are notorious for only showing up on specific hinge angles, specific split ratios, or after several fold cycles in a single session — exactly the kind of state that's hard to reproduce from a bug report alone. Session-level crash context (device model, screen size and posture at crash time, and the sequence of configuration changes leading up to it) is what turns "crashes sometimes on foldables" into a reproducible, fixable bug.

Ready to debug foldable and multi-window crashes with full context? Start your free BugsPulse trial and get automatic posture-aware crash reporting for every foldable device on the market.