Recommended Free Tools
iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more
If the Android system Back button now closes your React Native app after you changed targetSdkVersion to 36, the usual cause is Android 16 predictive-back enforcement. For apps targeting API 36, Android no longer calls Activity.onBackPressed() or dispatches KeyEvent.KEYCODE_BACK. Legacy native handlers therefore fail to consume the event, and React Native falls through to its default behavior: exiting when no back-handler subscription returns true.
The durable fix is to migrate native interception to AndroidX OnBackPressedDispatcher/OnBackPressedCallback (or the platform OnBackInvokedCallback), then make each JavaScript screen return true only when it actually handles Back. A manifest opt-out can restore legacy behavior temporarily, but it removes predictive-back behavior and should be treated as a migration bridge.
Why target SDK 36 changes Back behavior
Android 16 (API level 36) changes the dispatch path for applications that target API 36 or higher and run on Android 16 or later. Predictive-back animations are enabled by default, including back-to-home, cross-task and cross-activity animations. At the same time, two legacy interception points stop working:
Crashes, No Sound, or Screen Glitches?
Random freezes, missing sound and display glitches usually trace back to one bad driver. Find and replace yours safely.Free scan · under a minuteWindows Errors? Fix Them Before They Spread
Repair common Windows errors and clear accumulated junk for a smoother, more stable PC - no reinstall needed.Free scan · no reinstallActivity.onBackPressed()is no longer called.KeyEvent.KEYCODE_BACKis no longer dispatched.
This is an Android platform behavior change, not evidence that your JavaScript navigation state suddenly became invalid. A React Native app can still navigate normally when a screen receives a Back event through the supported dispatcher. The failure occurs when a custom Activity, Fragment, library or native module still expects one of the removed callbacks.
#1 Best Overall
- 【Strong Adsorption】The inspiration of the silicone phone suction case comes from the adhesive force of the octopus. Each suction cup phone mount is 3.15 inches long and 2.17 inches wide, with 24 independent suction cups providing a stronger and more stable suction force, so you don't have to worry about your phone falling during use.
- 【Back of Phone Suction Grip】Remove the adhesive film on the phone suction cup and stick it on the phone case. You can then fix the phone on any smooth surface, which is very convenient. (The phone suction cup cannot be removed and reused after being attached to the phone case. It is recommended to attach it to a regular phone case, not a valuable one.)
- 【Widely Used】Our non-slip silicone phone sticky grip mount attaches to almost any flat phone case and make it compatible with common mobile phones such as iPhone and Android.You can shoot, watch videos or video calls in the kitchen, gym, dance studio, bathroom and other places.
- 【Capture the Wonderful Picture】Whether you are a TikTok creator or just like to share videos and photos, this phone suction cup can help you hands-free capture wonderful videos and photos for sharing with friends.
- 【Note】You can fix the phone suction cup on a smooth surface such as a mirror or glass. If necessary, wipe the suction cup with a damp cloth to obtain stronger suction. Before releasing your hand, make sure the phone is firmly fixed. (Not applicable to rough walls, wooden surfaces, and other uneven surfaces)
React Native’s documented BackHandler contract remains important: a listener must return true after consuming the event. If every listener returns false, or no listener is registered, React Native allows the default system behavior, which normally exits the app at that point in the back stack.
Recognize which layer is failing
Use the symptom and your project code to separate a JavaScript-only problem from a native migration problem.
| Observation | Most likely cause | First action |
|---|---|---|
| Back closes the app on Android 16 only after changing the target to 36 | Legacy native interception is being bypassed | Search Activities, Fragments and native modules for onBackPressed() and KEYCODE_BACK |
| A screen should navigate back but has no active listener | No JavaScript consumer is registered | Add a screen-scoped BackHandler listener |
| A listener runs but the app still exits | The callback returns false even after navigation, or another handler owns the event |
Return true only after this screen performs the back action |
| Only a custom Activity or native module fails | That component owns an obsolete interception point | Migrate that component to the AndroidX dispatcher or platform callback |
| The issue appears on gesture and three-button navigation | Expected Android 16 predictive-back coverage | Test both navigation modes; Android 16 extends predictive back to three-button navigation |
Permanent migration plan
1. Inventory every legacy interception point
Search application code and dependency sources, not only your JavaScript directory. Look in android/app/src, included Android libraries, custom React Native packages and any Activity launched by a native feature.
Quick wins for a faster PC:
Fix the driver behind crashes, sound loss and screen glitchesFind Drivers →Repair Windows errors before they cause bigger problemsFix Now →rg -n "onBackPresseds*(|KEYCODE_BACK|dispatchKeyEvent|onKeyDown" android node_modules
Review each match in context. An override that merely logs the event may be harmless, while code that opens a drawer, dismisses a modal, finishes an Activity or forwards a callback must be migrated. Also check custom host Activities and Fragments: a React Native host that overrides back behavior can bypass the framework’s supported path.
2. Replace Activity overrides with AndroidX dispatch
AndroidX OnBackPressedDispatcher is the backward-compatible choice when your Activity or Fragment needs to intercept Back across Android versions. Register an OnBackPressedCallback, enable it only while that component owns the event, and remove or disable it with the component lifecycle.
class DetailsActivity : ComponentActivity() {
private val backCallback = object : OnBackPressedCallback(false) {
override fun handleOnBackPressed() {
if (closeDetailsPanel()) {
return
}
// Disable this callback before delegating, so the dispatcher can continue.
isEnabled = false
onBackPressedDispatcher.onBackPressed()
isEnabled = true
}
}
override fun onCreate(state: Bundle?) {
super.onCreate(state)
onBackPressedDispatcher.addCallback(this, backCallback)
backCallback.isEnabled = detailsPanelIsOpen()
}
}
The exact delegation logic depends on whether the Activity is closing a panel, popping a Fragment, or handing control to React Native. Do not leave a callback permanently enabled if it cannot consume Back; an enabled callback that does nothing can block the next owner.
In Java, the same API is available through getOnBackPressedDispatcher().addCallback(...) and an OnBackPressedCallback whose handleOnBackPressed() method performs the action. Keep the callback lifecycle-bound to the Activity or Fragment so it cannot outlive the UI that owns it.
3. Use the platform callback when you need direct predictive-back integration
Android also supports OnBackInvokedCallback, the platform callback designed for predictive back. Use it when your native component needs the direct Android 13-and-later API and you can supply version-gated code. Android’s guidance identifies both OnBackPressedDispatcher and OnBackInvokedCallback as supported approaches.
Rank #2
- SUPERIOR COMFORT — Unlike traditional circular ear buds, the design of EarPods is defined by the geometry of the ear. Which makes them more comfortable for more people than any other ear bud–style headphones.
- HIGH-QUALITY AUDIO — The speakers inside EarPods have been engineered to maximize sound output and minimize sound loss, which means you get high-quality audio.
- BUILT-IN REMOTE — EarPods with USB-C plug also include a built-in remote that lets you adjust the volume, control the playback of music and video, and answer or end calls with a pinch of the cord.
- COMPATIBILITY — Works with all devices that have a USB-C port.
- INTEGRATED MICROPHONE — A built-in microphone precisely captures your voice while you’re on the phone, taking a FaceTime call, or summoning Siri — so you’re always heard loud and clear.
The AndroidX dispatcher is usually simpler for a React Native application because it provides backward-compatible behavior and lifecycle integration. A platform callback can be appropriate for a component that already owns Android’s predictive-back progress or needs a platform-specific priority. Do not register both for the same action without a clear ownership rule, or one callback can consume an event intended for the other.
4. Preserve React Native host integration
If you have a custom React Native host Activity or Fragment, route dispatcher events through the React Native back-handler interface rather than calling a removed onBackPressed() override. React Native’s integration guidance explicitly states that on Android 16 devices running apps targeting API 36, onBackPressed will no longer be called and OnBackPressedDispatcher should be used instead.
Check any Activity that extends or wraps the standard React Native host. If a native module starts its own Activity, that Activity needs its own dispatcher callback and must define what happens when the React Native screen cannot consume Back. Keep ownership explicit: a native modal should dismiss itself first; otherwise the event should continue to the React Native navigation layer or system.
Implement the JavaScript BackHandler contract
After native dispatch reaches React Native, each screen that consumes Back must register a listener and report whether it handled the event. The following pattern navigates back when a previous route exists and lets the system decide what to do at the root screen.
import { useEffect } from 'react';
import { BackHandler } from 'react-native';
function DetailsScreen({ navigation }) {
useEffect(() => {
const subscription = BackHandler.addEventListener(
'hardwareBackPress',
() => {
if (navigation.canGoBack()) {
navigation.goBack();
return true;
}
return false; // no screen-level action; continue to system handling
},
);
return () => subscription.remove();
}, [navigation]);
return null;
}
Adapt the condition to your navigation library and screen ownership. For example, a screen with an open drawer can close the drawer and return true; the same screen can then return true again when it pops a route. Return false only when this listener deliberately declines the event. Returning true without changing UI state makes Back appear broken because the event has been consumed.
Handle modals, nested navigators and asynchronous state
- Modal or drawer open: close it synchronously, then return
true. Do not also pop the navigation stack for the same press. - Nested navigator: ask the active child navigator first. If it cannot go back, allow the parent navigator to decide.
- Root route: return
falsewhen there is no in-app action. This permits the normal system/root behavior instead of pretending the press was handled. - Changing state: keep the listener registered while the screen is focused and read current state from the callback. Remove the subscription when the screen unmounts or loses ownership.
Temporary compatibility opt-out
If you cannot migrate native code immediately, disable the predictive-back callback for the affected application or Activity in AndroidManifest.xml:
<application
android:enableOnBackInvokedCallback="false"
... >
Place the attribute at the application scope when the whole app still depends on legacy interception, or at an affected Activity scope when only one native surface needs the bridge. This is a compatibility measure, not a permanent fix: it sacrifices predictive-back callback behavior for that scope. Remove the attribute after migrating and testing native handlers.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Keep the opt-out narrowly scoped where possible. A broad application-level setting can hide an unmigrated library while also disabling predictive behavior for Activities that are already compatible.
Rank #3
- Secure Hold: Our PopSockets adhesive phone grip gives your cell phone a secure, comfortable hold in hand to help prevent drops while texting, taking photos, or scrolling on the go. Designed to stick firmly to most phone cases and devices.
- Hands-Free Made Easy: Easily turn your PopSocket into a phone stand to prop up your phone anywhere, perfect for watching videos, video calls, or following recipes. A must-have phone holder that keeps your device secure and ready for anything.
- Compatibility: Works with all phones, tablets, and Kindles. Sticks best to smooth, hard plastic cases and may not adhere to silicone or textured cases. Easily swap your PopTop to change up your style.
- Black PopSockets: Simple, refined, and endlessly versatile. A timeless essential for any phone.
- Travel Must-Have for People On the Go: A must-have travel accessory for flights, flying, airports, air travel, airplanes, planes, international trips, cruises, and long travel days. Key gadget for your airport haul, travel accessories and must-haves.
React Native version considerations
React Native 0.81 defaults to targeting Android 16/API 36. Its release guidance says the BackHandler API should continue to work for most use cases, while applications that override onBackPressed() in custom native code may need a manual migration or a temporary opt-out.
Updating React Native can reduce framework incompatibility, but it cannot automatically rewrite your application’s custom Activities, Fragments or native modules. After an upgrade, repeat the source search and inspect every custom back path. A project can be on a release with Android 16 support and still fail because a third-party or in-house module owns a legacy override.
Test the migration on Android 16
Use an Android 16/API 36 physical device or emulator with both navigation modes. A single successful gesture test is not enough because Android 16 also applies predictive-back behavior to three-button navigation.
Free tools Windows power users keep installed
One-click scans. No signup required.
| Area | Cases to execute | Expected result |
|---|---|---|
| Navigation mode | Gesture navigation; three-button navigation | Back reaches the same in-app handler or system result in both modes |
| Route depth | Nested route; parent route; root route | Child consumes first, parent receives only when appropriate, root does not unexpectedly close a screen |
| Transient UI | Drawer, dialog, bottom sheet or custom modal | Transient UI closes before navigation is popped |
| Native surfaces | Every custom Activity and Fragment; modules that launch an Activity | Dispatcher or platform callback handles Back without relying on onBackPressed() |
| Predictive gesture | Start and complete a back gesture; cancel a gesture midway | Completed Back performs the action; a cancelled gesture leaves state unchanged |
| Older Android | At least one pre-Android-16 device or emulator | AndroidX compatibility path preserves existing behavior |
Capture logs while testing and identify which layer consumes each press. If a native callback fires but JavaScript navigation does not, the handoff is wrong. If JavaScript logs the event and returns true but the app still exits, check for a second Activity, an incorrectly scoped listener, or a native callback that finishes the Activity after dispatch.
Common failure modes and corrections
The code search finds no legacy override
Inspect dependencies and generated or included Android modules, not only your app module. A package can override an Activity method in its own source. If the project has no native interception at all, focus on JavaScript ownership: verify that the active screen registers BackHandler, that the effect is not immediately removed, and that the callback returns true after navigation.
The listener returns false after calling navigation
Calling navigation.goBack() and then returning false allows another handler or the system to process the same press. Return true when that navigation action was initiated by this listener.
An enabled dispatcher callback swallows Back
Ensure the callback either completes a visible action or disables itself before delegating. A callback that remains enabled while its screen is hidden can prevent the active screen or React Native from receiving Back.
The Tool Desk
Outbyte PC Repair FREERepair Windows errors before they cause bigger problemsFix Now →Outbyte Driver Updater FREEFix the driver behind crashes, sound loss and screen glitchesFind Drivers →The opt-out appears to fix the issue, but predictive animation is missing
That is the expected trade-off of android:enableOnBackInvokedCallback="false". Treat the result as confirmation that a legacy interception path remains, then migrate it and remove the attribute.
Rank #4
- [360 ° Flexible Rotation Design] Comes with a rotatable lanyard ring that supports 360 ° free rotation, effectively solving the problem of twisted and tangled lanyards
- [Wide compatibility] The ultra-thin 0.02-inch design does not block the charging port at all, and both wired and wireless charging can be used directly without removing the pad. Compatible with most smartphones such as iPhone, compatible with various wristbands, lanyards, crossbody straps, and keychains
- [Durable and Portable Material] Premium rust-resistant stainless steel material with good flexibility, which not only avoids scratching the phone case, but also has excellent anti rust and anti fading performance
- [Multi scenario Practical] Paired with a lanyard or wristband, hands-free use can be achieved. The phone is within reach and not easily dropped, ideal for daily commuting and outdoor activities. Suitable for full coverage phone cases, does not support half coverage phone cases
- [Quality Service] If you find any damage or other issues with the product upon receipt, please contact us immediately. We will handle it quickly
Only the root screen exits
At the root, an exit can be correct when no listener consumes Back. If the product requires a confirmation dialog, register a root-screen listener that shows the dialog and returns true; return false only when the system should own the action.
Choosing the right fix
| Situation | Recommended action | Trade-off |
|---|---|---|
| Only screen navigation is missing a consumer | Add or correct a JavaScript BackHandler listener |
Fastest change; does not fix native modules using obsolete callbacks |
| Custom Activity or Fragment intercepts Back | Migrate to AndroidX OnBackPressedDispatcher |
Backward-compatible and lifecycle-aware; requires native code changes |
| Native component needs direct predictive-back integration | Use platform OnBackInvokedCallback with version gating |
Direct platform control; more Android-version-specific code |
| Release is blocked and migration cannot finish | Set android:enableOnBackInvokedCallback="false" for the smallest required scope |
Restores compatibility temporarily but disables predictive-back callback behavior |
The lasting solution combines the correct native dispatch API with explicit JavaScript ownership. Upgrading to a React Native release that supports Android 16 reduces framework risk, while an audit of custom native code prevents the same failure from returning through a module or host Activity.
Clarify the target and device combination
Changing targetSdkVersion to 36 does not by itself make every Android version use the new dispatch path. The strict behavior described here occurs when the app targets API 36 or higher and runs on an Android 16 or later device. Older Android versions still use the compatibility behavior provided by AndroidX or by the platform’s older dispatch mechanisms. That is why a regression can appear only on a new emulator or a particular user’s Android 16 phone after an otherwise routine build change.
Verify the merged manifest and the installed APK’s target level, not just a Gradle variable in one module. A library module can contain the obsolete code even when the application module does not. Likewise, test the Activity that actually receives the press: a sign-in, payment, media, or document-picker Activity may not be the same host Activity that renders your React Native navigator.
Make callback ownership explicit
Back handling is easiest to reason about as a chain of owners. The topmost transient surface gets the first opportunity, then the active child navigator, then its parent, then the host Activity or system. Each owner must do exactly one of two things: complete a visible action and consume the event, or decline it so the next owner can run.
With AndroidX, callback registration order and enabled state determine which callback is considered first. Register callbacks with a lifecycle owner, enable them only while their UI is visible, and disable them before delegating to the dispatcher. In a Fragment, do not keep a callback enabled after the Fragment is detached or after another Fragment becomes primary. In JavaScript, focus-based registration prevents an unfocused nested screen from consuming a press intended for the current screen.
Avoid a loop in which a native callback invokes the dispatcher while still enabled, or a JavaScript listener triggers a native finish operation and then returns false. Instrument the path temporarily with logs that identify the Activity, callback, route, and return value. The useful trace is one press, one owner, and one state transition.
Release checklist
- Confirm the release’s target is API 36 and identify every Activity shipped in the APK.
- Search app, dependency, and native-module sources for
onBackPressed(),KEYCODE_BACK,dispatchKeyEvent, andonKeyDown. - Migrate custom interception to a lifecycle-bound
OnBackPressedCallback, or use a version-gatedOnBackInvokedCallbackfor direct platform integration. - Verify the React Native host forwards dispatcher events into the back-handler interface.
- For each screen, test the listener’s return value:
trueafter a real action,falseonly when the next owner should decide. - Exercise gesture and three-button navigation on Android 16, then repeat key flows on a pre-Android-16 device.
- If an opt-out is present, document its scope and removal condition; do not ship it as an unexplained permanent setting.
There is no phone, cable, or paid service required to correct this defect. The work is an API migration, JavaScript ownership fix, and device/emulator validation. The main release cost is engineering and regression-test time, especially when third-party modules launch their own Activities.
Best Value
- 【PKYAA Double Sided Silicone Suction Phone Case Mount】PKYAA With Double Sided 40 Strong and Reliable individual suction cups, PKYAA provides a thicken and upgraded universal silicon suction mount for your phone.
- 【Friendly to Content Creators】If you are a content creator or an online influencer, you can create videos anywhere with this suction mount completely hands free with this silicone cell phone mount for cases.
- 【HANDS-FREE & Adhere to Mirrors】This Double Sided silicone suction phone case mount allows you to stick your phone to the mirror easily. No longer holding your phone in one hand to watch video tutorials while making up.
- 【Strong Grip on the Smooth Surface】You can easily hang your phone anywhere with a smooth surface. All you do is you clean off your phone and smooth surface. It is STURDY and it not only sticks to mirrors, it also sticks to windows, it sticks to refrigerators, tiles and other clean, flat surfaces.
- 【Press Down Firmly Every 30 Minutes】Use your palm or fingers to press the phone down firmly and check it's secure before letting go. Apply even pressure for a few seconds to allow the suction cup to adhere properly. To maintain the grip and prevent accidental falls, it's a good practice to periodically reapply pressure to the suction cup.
Frequently Asked Questions
Why does Back exit only after I set targetSdkVersion to 36?
Android 16 enforces predictive-back behavior for apps targeting API 36. It no longer calls Activity.onBackPressed() or dispatches KEYCODE_BACK, so legacy native code may not consume the event. React Native then exits when no BackHandler listener returns true.
Is this always a React Navigation bug?
No. React Native BackHandler should continue to work for most use cases. First determine whether the active screen lacks a listener or whether a custom Activity, Fragment, dependency, or native module still relies on a removed Android callback.
Should I use OnBackPressedDispatcher or OnBackInvokedCallback?
Use AndroidX OnBackPressedDispatcher for backward-compatible, lifecycle-aware handling across Android versions. Use OnBackInvokedCallback when a native component needs direct Android 13-and-later predictive-back integration and can version-gate that code.
What should a BackHandler listener return?
Return true only after the listener performs the action, such as closing a drawer or navigating back. Return false when the screen has no action and the parent navigator or system should continue handling the press.
Why does my listener run but the app still close?
The callback may return false after calling navigation, belong to an unfocused screen, or be followed by a native callback that finishes another Activity. Log the listener, route, return value, and Activity, then ensure one owner consumes the event.
Can I keep enableOnBackInvokedCallback=false permanently?
It is documented as a temporary compatibility opt-out. It disables predictive-back callback behavior for the application or Activity scope. Keep it narrow while migrating, then remove it after native handlers are converted and tested.
Does Android 16 predictive back apply to three-button navigation?
Yes. Test both gesture and three-button navigation. A flow that works with a gesture can still expose an ownership or callback problem through the three-button Back control.
Do these 3 things before closing this tab:
1Clear out junk files and repair common Windows errors2Scan for outdated or missing drivers - takes under a minute3Repair Windows errors before they cause bigger problemsWill upgrading React Native fix custom native modules automatically?
No. React Native 0.81 targets Android 16 by default and supports BackHandler for most use cases, but custom Activities, Fragments, and native modules that override onBackPressed() still require manual migration or the temporary opt-out.
The Bottom Line
Target SDK 36 exposes obsolete Android back interception on Android 16: onBackPressed() and KEYCODE_BACK are no longer dependable. Move native handling to OnBackPressedDispatcher or OnBackInvokedCallback, make focused React Native listeners return true only when they consume Back, and validate gesture, three-button, nested-navigation, modal, native-Activity, and older-Android flows. Use android:enableOnBackInvokedCallback="false" only as a narrowly scoped bridge.
Quick Recap
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

