Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,11 +122,12 @@ public void onBackPressed() {
public void invokeDefaultOnBackPressed() {
// Disabling callback so the fallback logic (finish activity) can run
// as super.onBackPressed() will call all enabled callbacks in the dispatcher.
boolean enabled = mBackPressedCallback.isEnabled();
mBackPressedCallback.setEnabled(false);
super.onBackPressed();
// Re-enable callback to ensure custom back handling works after activity resume
// Without this, the callback remains disabled when the app returns from background
mBackPressedCallback.setEnabled(true);
mBackPressedCallback.setEnabled(enabled);
}

@Override
Expand Down Expand Up @@ -182,4 +183,8 @@ protected final ReactInstanceManager getReactInstanceManager() {
protected final void loadApp(String appKey) {
mDelegate.loadApp(appKey);
}

protected OnBackPressedCallback getBackPressedCallback() {
return mBackPressedCallback;
}
}
Loading