|
@@ -54,6 +54,7 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
54
|
54
|
* Along with that, we should handle commands from the bridge using onNewIntent
|
55
|
55
|
*/
|
56
|
56
|
static NavigationActivity currentActivity;
|
|
57
|
+ private static Promise startAppPromise;
|
57
|
58
|
|
58
|
59
|
private ActivityParams activityParams;
|
59
|
60
|
private ModalController modalController;
|
|
@@ -123,12 +124,20 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
123
|
124
|
currentActivity = this;
|
124
|
125
|
IntentDataHandler.onResume(getIntent());
|
125
|
126
|
getReactGateway().onResumeActivity(this, this);
|
|
127
|
+ resolveStartAppPromiseOnActivityResumed();
|
126
|
128
|
NavigationApplication.instance.getActivityCallbacks().onActivityResumed(this);
|
127
|
129
|
EventBus.instance.register(this);
|
128
|
130
|
IntentDataHandler.onPostResume(getIntent());
|
129
|
131
|
NavigationApplication.instance.getEventEmitter().sendActivityResumed(getCurrentlyVisibleEventId());
|
130
|
132
|
}
|
131
|
133
|
|
|
134
|
+ private void resolveStartAppPromiseOnActivityResumed() {
|
|
135
|
+ if (startAppPromise != null) {
|
|
136
|
+ startAppPromise.resolve(true);
|
|
137
|
+ startAppPromise = null;
|
|
138
|
+ }
|
|
139
|
+ }
|
|
140
|
+
|
132
|
141
|
@Override
|
133
|
142
|
protected void onNewIntent(Intent intent) {
|
134
|
143
|
super.onNewIntent(intent);
|
|
@@ -149,9 +158,16 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
149
|
158
|
@Override
|
150
|
159
|
protected void onStop() {
|
151
|
160
|
super.onStop();
|
|
161
|
+ clearStartAppPromise();
|
152
|
162
|
NavigationApplication.instance.getActivityCallbacks().onActivityStopped(this);
|
153
|
163
|
}
|
154
|
164
|
|
|
165
|
+ private void clearStartAppPromise() {
|
|
166
|
+ if (startAppPromise != null) {
|
|
167
|
+ startAppPromise = null;
|
|
168
|
+ }
|
|
169
|
+ }
|
|
170
|
+
|
155
|
171
|
@Override
|
156
|
172
|
protected void onDestroy() {
|
157
|
173
|
destroyLayouts();
|
|
@@ -464,4 +480,8 @@ public class NavigationActivity extends AppCompatActivity implements DefaultHard
|
464
|
480
|
public String getCurrentlyVisibleEventId() {
|
465
|
481
|
return modalController.isShowing() ? modalController.getCurrentlyVisibleEventId() : layout.getCurrentScreen().getNavigatorEventId();
|
466
|
482
|
}
|
|
483
|
+
|
|
484
|
+ public static void setStartAppPromise(Promise promise) {
|
|
485
|
+ NavigationActivity.startAppPromise = promise;
|
|
486
|
+ }
|
467
|
487
|
}
|