Predictive Back Gesture Migration: What Breaks When You Target API 36

Hamza Fazal, Founder, DEESUHamza FazalFounder, DEESUUpdated 7 min readAndroid Development

Google Play now requires new apps and updates to target Android 16 (API level 36) by August 31, 2026, with a one-time extension available to eligible developers until November 1, 2026. Most teams treat that as a compileSdk bump and a round of regression testing. The part that actually breaks things is smaller and easier to miss: the predictive back gesture, and specifically what happens to every screen that still overrides the deprecated onBackPressed() instead of registering a proper back callback.

What the August 31 deadline actually requires

The rule set has three tiers. New apps and app updates need to target API 36 or higher by the deadline to be accepted by Google Play, except Wear OS and Android Automotive OS apps, which need API 35, and Android TV and Android XR apps, which need API 34. Separately, apps already on Play need to target at least API 35 to stay available to new users on devices running a newer OS version than the app's declared target — so even a team not shipping an update this cycle can lose visibility on new devices if they've let their target SDK lag.

The extension to November 1, 2026 is a one-time grace period requested through Play Console, not an automatic rollover, and it doesn't change what breaks once you actually raise targetSdk — it only buys time to fix it. For a team weighing whether to request it, the honest answer is that the extension is worth taking if you haven't started; it isn't a reason to skip the predictive back gesture work, because that work has to happen before the new deadline either way.

We'd also flag the third-party dependency check most teams underweight: a targetSdk 36 bump can surface incompatibilities in navigation libraries, bottom-sheet components, and any wrapper around fragment transactions that assumed the old onBackPressed() contract. Confirming those libraries have shipped a predictive-back-aware release is worth doing in the same pass as the SDK bump, not after QA finds the gap.

Why predictive back gesture is the real migration cost

Predictive back gesture itself isn't new — Android 13 introduced the platform-level animation, and Android 14 let apps opt in. What changes at API 36 is enforcement: Android 16 drives the predictive back animation more aggressively against apps that still rely on the deprecated onBackPressed() override, and calls into that deprecated path can no longer drive the predictive preview at all. In practice that means a screen that used to show a smooth swipe-back animation with a live preview of the previous screen now either shows no animation, shows the wrong animation, or in some navigation stacks closes the app outright on a swipe that should have gone back one level.

This is the part that doesn't show up in a changelog skim. compileSdk/targetSdk bumps to 36 and Play Billing Library upgrades get caught by a build failure or a Play Console warning. A broken predictive back animation on one specific screen in a deep navigation stack gets caught by nobody until a user reports the app closing when they swipe back — which is exactly the kind of regression that's expensive to trace after the fact and cheap to catch with a deliberate audit before it ships.

Migrating View-based back handling

OnBackPressedCallback is backward compatible, so it keeps working through the deprecated onBackPressed() path on older OS versions — but a deprecated override cannot drive a predictive preview no matter how new the device is. The fix is to replace every onBackPressed() override with a registered OnBackPressedCallback through OnBackPressedDispatcher, and to keep that callback's isEnabled state accurate to the screen's actual state (for example, disabling it when there's nothing left to intercept, so the system falls through to default back behavior instead of swallowing the gesture). The practical first step on an existing codebase is a repo-wide search for onBackPressed overrides — that search is the actual scope of the migration, not the SDK version bump.

Handling it in Jetpack Compose with PredictiveBackHandler

For Compose UI, the idiomatic tool is PredictiveBackHandler (available since activity-compose 1.8.0-alpha01), which exposes a Flow<BackEventCompat> instead of a single boolean callback. Each emitted value carries the gesture's progress from 0 to 1, which swipe edge triggered it, and the current touch coordinates — enough to drive a custom transition that tracks the user's finger in real time rather than just reacting after the gesture completes. That's a materially different API shape than the old BackHandler(enabled) { } callback most Compose codebases already use for simple back interception, and reusing that same mental model for anything that should animate with the swipe (a bottom sheet, a nested nav host, a custom transition) will compile fine and still look broken on a real device.

A practical audit, step by step

An audit is quicker than it sounds, because the scope is a search result, not a guess. This is the order we use on an existing app.

  1. Search the repository for onBackPressed overrides and for BackHandler usages in Compose. Make a list of every screen involved.
  2. Group screens by type: activities, fragments, dialogs and bottom sheets, nested navigation hosts. Each type has a slightly different fix.
  3. Replace one group at a time and keep each callback's isEnabled state accurate, so the system can fall back to default behaviour when you have nothing to intercept.
  4. Turn on predictive back in Developer Options and swipe through every navigation path on a real device.
  5. Check third-party libraries for predictive-back-aware releases, especially navigation and bottom-sheet components.
  6. Add regression notes to your release checklist so new screens follow the same pattern.
// Compose: a custom transition that follows the finger
PredictiveBackHandler(enabled = sheetOpen) { progress: Flow<BackEventCompat> ->
    try {
        progress.collect { event -> sheetOffset = event.progress }
        sheetOpen = false // gesture committed
    } catch (e: CancellationException) {
        sheetOffset = 0f // gesture cancelled
    }
}
The shape of the Compose API: you receive progress events, not a single callback.

A checklist for the release

  • No onBackPressed() overrides remain in app code.
  • Every custom back interception uses a registered callback with accurate enabled state.
  • Predictive back animations were checked on a real device for each major flow.
  • Navigation, bottom-sheet and fragment libraries are on predictive-back-aware versions.
  • The Play Console target API requirement is confirmed for your app type.
  • The extension decision is made and recorded, with a date.

What we'd actually recommend

Don't treat this as a targetSdk checkbox. Before raising targetSdk to 36, grep the codebase for every onBackPressed() override and every ad hoc BackHandler in Compose, and replace them with OnBackPressedCallback/PredictiveBackHandler deliberately, screen by screen. Turn on the predictive back animation in Developer Options and manually swipe through every major navigation path — nested fragments, bottom sheets, modal dialogs, multi-level Compose nav graphs — since this is exactly the class of bug that unit tests don't catch and a five-minute manual pass does. If you're not going to finish that audit before August 31, request the Play Console extension now rather than rushing the migration in the last week; the extra two months is meant for exactly this kind of screen-by-screen check, not for skipping it.

Frequently asked questions

Raising compileSdk alone does not change runtime behaviour. Raising targetSdk is what opts the app into the newer platform behaviour, including predictive back.

Register an OnBackPressedCallback through the OnBackPressedDispatcher for View-based screens, and use BackHandler or PredictiveBackHandler in Compose.

Callbacks registered through the dispatcher are backward compatible, which is why migrating them is safe for every device you support.

No. It is a one-time extension you request in Play Console if you are eligible. Check the current rules there.

For a small or medium app, usually a few days of focused work, plus device testing. Large apps with deep navigation take longer.

Sources

ShareLinkedInX
Hamza Fazal, Founder, DEESU

Written by

Hamza Fazal

Founder, DEESU

Muhammad Hamza Fazal is the Founder of DEESU. An Android and full-stack web developer and digital marketer based in Islamabad, he founded DEESU in May 2022 and leads its engineering operations, product strategy, and client software delivery.

More from Hamza
Reply within 1 business day

Tell us what you're building.

Send the problem, not a polished brief. We'll tell you what it actually takes to ship it: stack, timeline and cost, before you commit to anything.