Skip to content
Merged
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
6 changes: 4 additions & 2 deletions docs/integration-with-android-fragment.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ This is required by React Native to handle the back button press event.

Go into your host activity and make sure it implements the `DefaultHardwareBackBtnHandler` interface:

> **Deprecated.** `Activity.onBackPressed()` has been [deprecated](<https://developer.android.com/reference/android/app/Activity#onBackPressed()>) since API level 33. Android 16 devices with apps targeting API level 36 this will [no longer be called](https://developer.android.com/about/versions/16/behavior-changes-16#predictive-back) and [OnBackPressedDispatcher](https://developer.android.com/reference/androidx/activity/OnBackPressedDispatcher) should be used instead.

<Tabs groupId="android-language" queryString defaultValue={constants.defaultAndroidLanguage} values={constants.androidLanguages}>
<TabItem value="kotlin">

Expand All @@ -56,7 +58,7 @@ import androidx.appcompat.app.AppCompatActivity
}

+ override fun invokeDefaultOnBackPressed() {
+ super.onBackPressed()
+ onBackPressedDispatcher.onBackPressed()
+ }
}
```
Expand Down Expand Up @@ -86,7 +88,7 @@ import androidx.appcompat.app.AppCompatActivity;

+ @Override
+ public void invokeDefaultOnBackPressed() {
+ super.onBackPressed();
+ getOnBackPressedDispatcher().onBackPressed();
+ }
}
```
Expand Down