Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More clarification with location of override #1187

Closed
wants to merge 1 commit into from
Closed
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
22 changes: 16 additions & 6 deletions versioned_docs/version-6.x/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,16 +68,26 @@ npx pod-install ios
`react-native-screens` package requires one additional configuration step to properly
work on Android devices. Edit `MainActivity.java` file which is located in `android/app/src/main/java/<your package name>/MainActivity.java`.

Add the following code to the body of `MainActivity` class:
Add the following override to the body of `MainActivity` class:

```java
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}
public class MainActivity extends ReactActivity {
//...code

//react-native-screens override
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(null);
}

public static class MainActivityDelegate extends ReactActivityDelegate {
//...code
}
```

and make sure to add the following import statement at the top of this file below your package statement:
Ensure you have placed this in the parent MainActivity and not inside the MainActivityDelegate.

Also, make sure to add the following import statement at the top of this file below your package statement:

```java
import android.os.Bundle;
Expand Down