You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/getting-started.md
+44-18Lines changed: 44 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -84,22 +84,37 @@ If you're on a Mac and developing for iOS, you need to install the pods (via [Co
84
84
npx pod-install ios
85
85
```
86
86
87
-
`react-native-screens` package requires one additional configuration step to properly
88
-
work on Android devices. Edit `MainActivity.kt` or `MainActivity.java` file which is located under `android/app/src/main/java/<your package name>/`.
87
+
:::info
88
+
89
+
When you use a navigator (such as stack navigator), you'll need to follow the installation instructions of that navigator for any additional dependencies. If you're getting an error "Unable to resolve module", you need to install that module in your project.
90
+
91
+
:::
92
+
93
+
#### Configuring `react-native-screens` on Android
89
94
90
-
Add the highlighted code to the body of `MainActivity` class:
95
+
[`react-native-screens`](https://github.com/software-mansion/react-native-screens) requires one additional configuration to properly work on Android.
96
+
97
+
Edit `MainActivity.kt` or `MainActivity.java` file under `android/app/src/main/java/<your package name>/`, and add the highlighted code to the body of `MainActivity` class:
and make sure to add the following import statement at the top of this file below your package statement:
127
-
128
-
```java
129
-
importandroid.os.Bundle;
130
-
```
131
-
132
149
This change is required to avoid crashes related to View state being not persisted consistently across Activity restarts.
133
150
134
-
:::info
151
+
#### Opting-out of predictive back on Android
135
152
136
-
When you use a navigator (such as stack navigator), you'll need to follow the installation instructions of that navigator for any additional dependencies. If you're getting an error "Unable to resolve module", you need to install that module in your project.
153
+
React Navigation doesn't yet support Android's predictive back gesture. Disabling it is necessary for the system back gesture to work properly with React Navigation.
137
154
138
-
:::
155
+
To opt out, in `AndroidManifest.xml`, in the `<application>` tag (or `<activity>` tag to opt-out at activity level), set the `android:enableOnBackInvokedCallback` flag to `false`:
0 commit comments