Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 20 additions & 26 deletions shell/platform/android/io/flutter/app/FlutterActivityDelegate.java
Original file line number Diff line number Diff line change
Expand Up @@ -167,19 +167,9 @@ public void onCreate(Bundle savedInstanceState) {
return;
}

if (!flutterView.getFlutterNativeView().isApplicationRunning()) {
String appBundlePath = FlutterMain.findAppBundlePath(activity.getApplicationContext());
if (appBundlePath != null) {
FlutterRunArguments arguments = new FlutterRunArguments();
ArrayList<String> bundlePaths = new ArrayList<>();
if (FlutterMain.getUpdateInstallationPath() != null) {
bundlePaths.add(FlutterMain.getUpdateInstallationPath());
}
bundlePaths.add(appBundlePath);
arguments.bundlePaths = bundlePaths.toArray(new String[0]);
arguments.entrypoint = "main";
flutterView.runFromBundle(arguments);
}
String appBundlePath = FlutterMain.findAppBundlePath(activity.getApplicationContext());
if (appBundlePath != null) {
runBundle(appBundlePath);
}
}

Expand Down Expand Up @@ -335,30 +325,34 @@ private boolean loadIntent(Intent intent) {
String route = intent.getStringExtra("route");
String appBundlePath = intent.getDataString();
if (appBundlePath == null) {
// Fall back to the installation path if no bundle path
// was specified.
// Fall back to the installation path if no bundle path was specified.
appBundlePath = FlutterMain.findAppBundlePath(activity.getApplicationContext());
}
if (route != null) {
flutterView.setInitialRoute(route);
}
if (!flutterView.getFlutterNativeView().isApplicationRunning()) {
FlutterRunArguments args = new FlutterRunArguments();
ArrayList<String> bundlePaths = new ArrayList<>();
if (FlutterMain.getUpdateInstallationPath() != null) {
bundlePaths.add(FlutterMain.getUpdateInstallationPath());
}
bundlePaths.add(appBundlePath);
args.bundlePaths = bundlePaths.toArray(new String[0]);
args.entrypoint = "main";
flutterView.runFromBundle(args);
}

runBundle(appBundlePath);
return true;
}

return false;
}

private void runBundle(String appBundlePath) {
if (!flutterView.getFlutterNativeView().isApplicationRunning()) {
FlutterRunArguments args = new FlutterRunArguments();
ArrayList<String> bundlePaths = new ArrayList<>();
if (FlutterMain.getUpdateInstallationPath() != null) {
bundlePaths.add(FlutterMain.getUpdateInstallationPath());
}
bundlePaths.add(appBundlePath);
args.bundlePaths = bundlePaths.toArray(new String[0]);
args.entrypoint = "main";
flutterView.runFromBundle(args);
}
}

/**
* Creates a {@link View} containing the same {@link Drawable} as the one set as the
* {@code windowBackground} of the parent activity for use as a launch splash view.
Expand Down