diff --git a/README.md b/README.md index 0ad27bad72..1cea7f01ad 100644 --- a/README.md +++ b/README.md @@ -51,13 +51,24 @@ On Android the View state is not persisted consistently across Activity restarts For most people using an app built from the react-native template, that means editing `MainActivity.java`, likely located in `android/app/src/main/java//MainActivity.java` You should add this code, which specifically discards any Activity state persisted during the Activity restart process, to avoid inconsistencies that lead to crashes. +Please note that the override code should not be placed inside `MainActivityDelegate`, but rather directly in `MainActivity`. ```java import android.os.Bundle; -@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 + } } ```