Selaa lähdekoodia

fix for late packer start

Daniel Zlotin 7 vuotta sitten
vanhempi
commit
7d919d38e9

+ 1
- 2
lib/android/app/src/main/java/com/reactnativenavigation/react/NavigationReactInitializer.java Näytä tiedosto

28
 			devPermissionRequest.askPermission(activity);
28
 			devPermissionRequest.askPermission(activity);
29
 		} else {
29
 		} else {
30
 			reactInstanceManager.onHostResume(activity, activity);
30
 			reactInstanceManager.onHostResume(activity, activity);
31
+			reactInstanceManager.addReactInstanceEventListener(this);
31
 			checkBundleThenPrepareReact(activity);
32
 			checkBundleThenPrepareReact(activity);
32
 		}
33
 		}
33
 	}
34
 	}
55
 						public void run() {
56
 						public void run() {
56
 							if (!packagerIsRunning) {
57
 							if (!packagerIsRunning) {
57
 								activity.toast("Packager is not running!");
58
 								activity.toast("Packager is not running!");
58
-								activity.finish();
59
 							} else {
59
 							} else {
60
 								prepareReactAppWithWorkingBundle();
60
 								prepareReactAppWithWorkingBundle();
61
 							}
61
 							}
69
 	}
69
 	}
70
 
70
 
71
 	private void prepareReactAppWithWorkingBundle() {
71
 	private void prepareReactAppWithWorkingBundle() {
72
-		reactInstanceManager.addReactInstanceEventListener(this);
73
 		if (shouldCreateContext()) {
72
 		if (shouldCreateContext()) {
74
 			reactInstanceManager.createReactContextInBackground();
73
 			reactInstanceManager.createReactContextInBackground();
75
 		} else if (waitingForAppLaunchEvent) {
74
 		} else if (waitingForAppLaunchEvent) {