File tree Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Expand file tree Collapse file tree 1 file changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ extension MainActivity {
35
35
public func onCreateSwift( _ savedInstanceState: BaseBundle ? ) {
36
36
log ( " \( self ) . \( #function) " )
37
37
38
- _onCreate ( )
38
+ _onCreate ( savedInstanceState )
39
39
}
40
40
}
41
41
@@ -45,10 +45,16 @@ private extension MainActivity {
45
45
typealias MainActor = AndroidMainActor
46
46
#endif
47
47
48
- func _onCreate( ) {
49
- MainActivity . shared = self
50
- runAsync ( )
51
- startMainRunLoop ( )
48
+ func _onCreate( _ savedInstanceState: BaseBundle ? ) {
49
+
50
+ // setup singletons
51
+ if savedInstanceState == nil , MainActivity . shared == nil {
52
+ MainActivity . shared = self
53
+ startMainRunLoop ( )
54
+ runAsync ( )
55
+ }
56
+
57
+ // need to recreate views
52
58
setRootView ( )
53
59
}
54
60
@@ -130,7 +136,6 @@ private extension MainActivity {
130
136
_ = getFragmentManager ( )
131
137
. beginTransaction ( )
132
138
. replace ( rootViewID, homeFragment)
133
- . addToBackStack ( nil )
134
139
. commit ( )
135
140
136
141
// Set as the content view
You can’t perform that action at this time.
0 commit comments