Common Orientation Change Bugs in Travel Apps: Causes and Fixes

Travel apps combine native Android activities, fragments, and WebView components with complex data flows such as booking, payment, and itinerary display. Orientation changes trigger Android’s configur

February 02, 2026 · 4 min read · Common Issues

What causes orientation change bugs in travel apps (technical root causes)

Travel apps combine native Android activities, fragments, and WebView components with complex data flows such as booking, payment, and itinerary display. Orientation changes trigger Android’s configuration‑change handling. If the activity does not declare android:configChanges or uses fragments without proper state management, the system destroys and recreates the view hierarchy. Common culprits:

On the web side, CSS media queries that rely on orientation without height fallback can cause layout shifts. JavaScript that re‑initialises components on resize without preserving state leads to data loss.

Real‑world impact (user complaints, store ratings, revenue loss)

When a user rotates a phone while searching for flights, the search results may disappear, the “Book Now” button may become unclickable, or entered passenger details may vanish. Immediate effects:

5‑7 specific examples of how orientation change bugs manifests in travel apps

#SymptomTypical root causeImpact on user flow
1Date picker shifts off screen, input fields clearedActivity recreation without saving onSaveInstanceStateUser must re‑select dates, increasing friction
2Flight search results grid collapses to a single column, overlapping with headerCSS flex container without flex-wrap and missing viewport metaSearch becomes unusable, users abandon
3Payment form fields lose focus, keyboard disappears mid‑entryEditText not handling onConfigurationChangedCard details lost, checkout fails
4Map view shows a blank placeholder while pins disappearMap SDK orientation lock + Activity restartUsers cannot locate destinations, booking stalls
5Filter pane collapses behind the toolbar, buttons become unreachableNested LinearLayout with fixed height, no layout_height="wrap_content"Filtering impossible, users resort to external search
6Error messages overlay UI elements, obscuring buttonsSnackbar or Toast positioned with absolute coordinates ignoring safe insetsUsers cannot dismiss errors, leading to retry loops
7Deep‑link navigation lands on wrong screen after rotationIntent handling in activity not preserving savedInstanceState across config changeUser ends up on home page instead of targeted itinerary

How to detect orientation change bugs (tools, techniques, what to look for)

  1. Manual rotation testing – Use an Android Emulator or physical device, rotate while recording UI state. Look for ANR dialogs, NullPointerException in logs, or UI elements disappearing.
  2. Automated UI testing – Write a script that programmatically rotates the screen (adb shell input keyevent 23 on Android, Ctrl+Shift+M in Chrome DevTools). Capture screenshots before/after and compare pixel differences.
  3. SUSA autonomous exploration – Upload the travel app APK or web URL. SUSA runs 10 persona‑driven test suites (curious, impatient, elderly, adversarial, novice, student, teenager, business, accessibility, power user). During each session it triggers orientation changes, records crashes, ANRs, dead buttons, and accessibility violations. The platform’s flow tracking logs each PASS/FAIL verdict for login, registration, checkout, and search, highlighting orientation‑related failures.
  4. Static analysis – Use lint rules that flag missing android:configChanges or android:windowSoftInputMode misconfigurations.
  5. Runtime monitoring – Instrument with ViewTreeObserver listeners to log layout changes on rotation. Combine with coverage analytics to see which UI elements are never exercised during orientation swaps.

How to fix each example (code-level guidance where applicable)

1. Date picker shift


@Override
public void onSaveInstanceState(Bundle outState) {
    super.onSaveInstanceState(outState);
    outState.putParcelable("date", datePicker.getDate());
}
@Override
public void onRestoreInstanceState(Bundle savedInstanceState) {
    super.onRestoreInstanceState(savedInstanceState);
    datePicker.updateDate(savedInstanceState.getParcelable("date"));
}

Declare android:configChanges="orientation|screenSize" and keep the fragment alive.

2. Search results grid collapse

Add meta name="viewport" content="width=device-width, initial-scale=1"> and ensure CSS:


.results { display: flex; flex-wrap: wrap; }
.item { flex: 1 0 200px; }

Use box-sizing: border-box to prevent overflow.

3. Payment form focus loss

For each EditText:


android:importantForAutofill="no"
android:imeOptions="actionDone"

Override onConfigurationChanged:


@Override
public void onConfigurationChanged(Configuration newConfig) {
    super.onConfigurationChanged(newConfig);
    // Preserve focus
    View focused = getCurrentFocus();
    if (focused instanceof EditText) {
        ((EditText) focused).clearFocus();
    }
}

4. Map view blank

Force map SDK to respect orientation:


MapView mapView = findViewById(R.id.map);
mapView.onCreate(savedInstanceState);
mapView.getMapAsync(canvas -> {
    canvas.getUiSettings().setRotateGesturesEnabled(true);
});

Declare android:configChanges="orientation|screenSize" and avoid setRequestedOrientation(ActivityInfo.SCREEN_ORIENTATION_PORTRAIT.

5. Filter pane collapse

Use layout_height="wrap_content" and layout_behavior="@string/appbar_scrolling_view_behavior. Ensure nested scrolls are properly nested:


<androidx.core.widget.NestedScrollView
    android:layout_height="wrap_content"
    android:layout_matchParentWidth="true"/>

6. Error messages overlay

Position snackbars with CoordinatorLayout and inset handling:


Snackbar.make(root, msg, Snackbar.LENGTH_LONG)
        .setAnchorView(R.id.fab)
        .show();

Avoid absolute positioning; use layout_gravity or margin based on safe area.

7. Deep‑link navigation

Store deep‑link data in Intent extras and restore in onNewIntent. Use SingleTask launch mode to keep activity alive:


@Override
protected void onNewIntent(Intent intent) {
    super.onNewIntent(intent);
    handleDeepLink(intent);
}

Prevention: how to catch orientation change bugs before release

Test Your App Autonomously

Upload your APK or URL. SUSA explores like 10 real users — finds bugs, accessibility violations, and security issues. No scripts.

Try SUSA Free