This is a breaking change and has to be opt-in. To prevent host.clear from being called,
Override `clearHostOnActivityDestroy` in MainApplication and return false:
```java
@Override
public boolean clearHostOnActivityDestroy() {
return false;
}
```
If host isn't cleared, the next time the app is opened react context might still be initialized.
In this case we emit appLaunched event which has to be handled in Js:
```js
Promise.resolve(Navigation.isAppLaunched())
.then((appLaunched) => {
if (appLaunched) {
startApp();
}
new NativeEventsReceiver().appLaunched(() => {
startApp();
});
})
```
|
||
| 118 | 118 |
|
| 119 | 119 |
|
| 120 | 120 |
|
| 121 |
|
|
| 122 |
|
|
| 123 |
|
|
| 124 |
|
|
| 121 | 125 |
|
| 122 | 126 |
|
| 123 | 127 |
|
|
||
| 135 | 135 |
|
| 136 | 136 |
|
| 137 | 137 |
|
| 138 |
|
|
| 138 |
|
|
| 139 | 139 |
|
| 140 | 140 |
|
| 141 | 141 |
|
|
||
| 166 | 166 |
|
| 167 | 167 |
|
| 168 | 168 |
|
| 169 |
|
|
| 169 |
|
|
| 170 | 170 |
|
| 171 | 171 |
|
| 172 | 172 |
|
|
||
| 27 | 27 |
|
| 28 | 28 |
|
| 29 | 29 |
|
| 30 |
|
|
| 31 |
|
|
| 32 | 30 |
|
| 33 | 31 |
|
| 34 | 32 |
|
|
||
| 38 | 36 |
|
| 39 | 37 |
|
| 40 | 38 |
|
| 41 |
|
|
| 39 |
|
|
| 42 | 40 |
|
| 43 | 41 |
|
| 44 | 42 |
|
|
||
| 63 | 63 |
|
| 64 | 64 |
|
| 65 | 65 |
|
| 66 |
|
|
| 67 |
|
|
| 68 |
|
|
| 69 |
|
|
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 66 |
|
|
| 67 |
|
|
| 68 |
|
|
| 69 |
|
|
| 70 |
|
|
| 71 |
|
|
| 72 |
|
|
| 73 |
|
|
| 74 |
|
|
| 73 | 75 |
|
| 74 | 76 |
|
| 75 | 77 |
|
|
||
| 23 | 23 |
|
| 24 | 24 |
|
| 25 | 25 |
|
| 26 |
|
|
| 26 |
|
|
| 27 | 27 |
|
| 28 |
|
|
| 28 |
|
|
| 29 | 29 |
|
| 30 | 30 |
|
| 31 | 31 |
|