File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -35,6 +35,7 @@ Please note that the override code should not be placed inside `MainActivityDele
35
35
36
36
``` java
37
37
import android.os.Bundle ;
38
+ import com.swmansion.rnscreens.RNScreensFragmentFactory ;
38
39
39
40
public class MainActivity extends ReactActivity {
40
41
@@ -43,7 +44,8 @@ public class MainActivity extends ReactActivity {
43
44
// react-native-screens override
44
45
@Override
45
46
protected void onCreate (Bundle savedInstanceState ) {
46
- super . onCreate(null );
47
+ getSupportFragmentManager(). setFragmentFactory(new RNScreensFragmentFactory ());
48
+ super . onCreate(savedInstanceState);
47
49
}
48
50
49
51
public static class MainActivityDelegate extends ReactActivityDelegate {
@@ -59,13 +61,15 @@ public class MainActivity extends ReactActivity {
59
61
60
62
``` kotlin
61
63
import android.os.Bundle;
64
+ import com.swmansion.rnscreens.RNScreensFragmentFactory;
62
65
63
66
class MainActivity : ReactActivity () {
64
67
65
68
// ...code
66
69
67
70
// react-native-screens override
68
71
override fun onCreate (savedInstanceState : Bundle ? ) {
72
+ supportFragmentManager.fragmentFactory = RNScreensFragmentFactory ()
69
73
super .onCreate(null );
70
74
}
71
75
}
You can’t perform that action at this time.
0 commit comments