@@ -167,19 +167,9 @@ public void onCreate(Bundle savedInstanceState) {
167
167
return ;
168
168
}
169
169
170
- if (!flutterView .getFlutterNativeView ().isApplicationRunning ()) {
171
- String appBundlePath = FlutterMain .findAppBundlePath (activity .getApplicationContext ());
172
- if (appBundlePath != null ) {
173
- FlutterRunArguments arguments = new FlutterRunArguments ();
174
- ArrayList <String > bundlePaths = new ArrayList <>();
175
- if (FlutterMain .getUpdateInstallationPath () != null ) {
176
- bundlePaths .add (FlutterMain .getUpdateInstallationPath ());
177
- }
178
- bundlePaths .add (appBundlePath );
179
- arguments .bundlePaths = bundlePaths .toArray (new String [0 ]);
180
- arguments .entrypoint = "main" ;
181
- flutterView .runFromBundle (arguments );
182
- }
170
+ String appBundlePath = FlutterMain .findAppBundlePath (activity .getApplicationContext ());
171
+ if (appBundlePath != null ) {
172
+ runBundle (appBundlePath );
183
173
}
184
174
}
185
175
@@ -335,30 +325,34 @@ private boolean loadIntent(Intent intent) {
335
325
String route = intent .getStringExtra ("route" );
336
326
String appBundlePath = intent .getDataString ();
337
327
if (appBundlePath == null ) {
338
- // Fall back to the installation path if no bundle path
339
- // was specified.
328
+ // Fall back to the installation path if no bundle path was specified.
340
329
appBundlePath = FlutterMain .findAppBundlePath (activity .getApplicationContext ());
341
330
}
342
331
if (route != null ) {
343
332
flutterView .setInitialRoute (route );
344
333
}
345
- if (!flutterView .getFlutterNativeView ().isApplicationRunning ()) {
346
- FlutterRunArguments args = new FlutterRunArguments ();
347
- ArrayList <String > bundlePaths = new ArrayList <>();
348
- if (FlutterMain .getUpdateInstallationPath () != null ) {
349
- bundlePaths .add (FlutterMain .getUpdateInstallationPath ());
350
- }
351
- bundlePaths .add (appBundlePath );
352
- args .bundlePaths = bundlePaths .toArray (new String [0 ]);
353
- args .entrypoint = "main" ;
354
- flutterView .runFromBundle (args );
355
- }
334
+
335
+ runBundle (appBundlePath );
356
336
return true ;
357
337
}
358
338
359
339
return false ;
360
340
}
361
341
342
+ private void runBundle (String appBundlePath ) {
343
+ if (!flutterView .getFlutterNativeView ().isApplicationRunning ()) {
344
+ FlutterRunArguments args = new FlutterRunArguments ();
345
+ ArrayList <String > bundlePaths = new ArrayList <>();
346
+ if (FlutterMain .getUpdateInstallationPath () != null ) {
347
+ bundlePaths .add (FlutterMain .getUpdateInstallationPath ());
348
+ }
349
+ bundlePaths .add (appBundlePath );
350
+ args .bundlePaths = bundlePaths .toArray (new String [0 ]);
351
+ args .entrypoint = "main" ;
352
+ flutterView .runFromBundle (args );
353
+ }
354
+ }
355
+
362
356
/**
363
357
* Creates a {@link View} containing the same {@link Drawable} as the one set as the
364
358
* {@code windowBackground} of the parent activity for use as a launch splash view.
0 commit comments