Flutter Engine
The Flutter Engine
Classes | Public Member Functions | Static Public Member Functions | Static Public Attributes | Protected Member Functions | Package Functions | List of all members
io.flutter.embedding.android.FlutterFragmentActivity Class Reference
Inheritance diagram for io.flutter.embedding.android.FlutterFragmentActivity:
io.flutter.embedding.android.FlutterEngineProvider io.flutter.embedding.android.FlutterEngineConfigurator io.flutter.embedding.android.FlutterFragmentActivityTest.FlutterFragmentActivityWithProvidedEngine

Classes

class  CachedEngineIntentBuilder
 
class  NewEngineInGroupIntentBuilder
 
class  NewEngineIntentBuilder
 

Public Member Functions

void onPostResume ()
 
void onRequestPermissionsResult (int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)
 
void onUserLeaveHint ()
 
void onTrimMemory (int level)
 
boolean shouldDestroyEngineWithHost ()
 
FlutterEngine provideFlutterEngine (@NonNull Context context)
 
void configureFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
void cleanUpFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
String getDartEntrypointFunctionName ()
 
List< String > getDartEntrypointArgs ()
 
String getDartEntrypointLibraryUri ()
 
FlutterEngine provideFlutterEngine (@NonNull Context context)
 
void configureFlutterEngine (@NonNull FlutterEngine flutterEngine)
 
void cleanUpFlutterEngine (@NonNull FlutterEngine flutterEngine)
 

Static Public Member Functions

static Intent createDefaultIntent (@NonNull Context launchContext)
 
static NewEngineIntentBuilder withNewEngine ()
 
static CachedEngineIntentBuilder withCachedEngine (@NonNull String cachedEngineId)
 
static NewEngineInGroupIntentBuilder withNewEngineInGroup (@NonNull String engineGroupId)
 

Static Public Attributes

static final int FRAGMENT_CONTAINER_ID = View.generateViewId()
 

Protected Member Functions

void onCreate (@Nullable Bundle savedInstanceState)
 
FlutterFragment createFlutterFragment ()
 
void onNewIntent (@NonNull Intent intent)
 
void onActivityResult (int requestCode, int resultCode, Intent data)
 
FlutterEngine getFlutterEngine ()
 
boolean shouldAttachEngineToActivity ()
 
boolean shouldHandleDeeplinking ()
 
String getAppBundlePath ()
 
Bundle getMetaData () throws PackageManager.NameNotFoundException
 
String getInitialRoute ()
 
String getCachedEngineId ()
 
String getCachedEngineGroupId ()
 
BackgroundMode getBackgroundMode ()
 
RenderMode getRenderMode ()
 
FrameLayout provideRootLayout (Context context)
 

Package Functions

FlutterFragment retrieveExistingFlutterFragmentIfPossible ()
 

Detailed Description

A Flutter Activity that is based upon FragmentActivity.

FlutterFragmentActivity exists because there are some Android APIs in the ecosystem that only accept a FragmentActivity. If a FragmentActivity is not required, you should consider using a regular FlutterActivity instead, because FlutterActivity is considered to be the standard, canonical implementation of a Flutter Activity.

Definition at line 61 of file FlutterFragmentActivity.java.

Member Function Documentation

◆ cleanUpFlutterEngine()

void io.flutter.embedding.android.FlutterFragmentActivity.cleanUpFlutterEngine ( @NonNull FlutterEngine  flutterEngine)
inline

Hook for the host to cleanup references that were established in configureFlutterEngine(FlutterEngine) before the host is destroyed or detached.

This method is called in onDestroy().

Implements io.flutter.embedding.android.FlutterEngineConfigurator.

Definition at line 745 of file FlutterFragmentActivity.java.

745 {
746 // No-op. Hook for subclasses.
747 }

◆ configureFlutterEngine()

void io.flutter.embedding.android.FlutterFragmentActivity.configureFlutterEngine ( @NonNull FlutterEngine  flutterEngine)
inline

Hook for subclasses to easily configure a FlutterEngine.

This method is called after provideFlutterEngine(Context).

All plugins listed in the app's pubspec are registered in the base implementation of this method unless the FlutterEngine for this activity was externally created. To avoid the automatic plugin registration for implicitly created FlutterEngines, override this method without invoking super(). To keep automatic plugin registration and further configure the FlutterEngine, override this method, invoke super(), and then configure the FlutterEngine as desired.

Implements io.flutter.embedding.android.FlutterEngineConfigurator.

Definition at line 727 of file FlutterFragmentActivity.java.

727 {
728 if (flutterFragment != null && flutterFragment.isFlutterEngineInjected()) {
729 // If the FlutterEngine was explicitly built and injected into this FlutterActivity, the
730 // builder should explicitly decide whether to automatically register plugins via the
731 // FlutterEngine's construction parameter or via the AndroidManifest metadata.
732 return;
733 }
734
735 GeneratedPluginRegister.registerGeneratedPlugins(flutterEngine);
736 }

◆ createDefaultIntent()

static Intent io.flutter.embedding.android.FlutterFragmentActivity.createDefaultIntent ( @NonNull Context  launchContext)
inlinestatic

Creates an Intent that launches a FlutterFragmentActivity, which executes a main() Dart entrypoint, and displays the "/" route as Flutter's initial route.

Definition at line 75 of file FlutterFragmentActivity.java.

◆ createFlutterFragment()

FlutterFragment io.flutter.embedding.android.FlutterFragmentActivity.createFlutterFragment ( )
inlineprotected

Creates the instance of the FlutterFragment that this FlutterFragmentActivity displays.

Subclasses may override this method to return a specialization of FlutterFragment.

Reimplemented in io.flutter.embedding.android.FlutterFragmentActivityTest.FlutterFragmentActivityWithProvidedEngine.

Definition at line 513 of file FlutterFragmentActivity.java.

513 {
514 final BackgroundMode backgroundMode = getBackgroundMode();
515 final RenderMode renderMode = getRenderMode();
516 final TransparencyMode transparencyMode =
517 backgroundMode == BackgroundMode.opaque
518 ? TransparencyMode.opaque
519 : TransparencyMode.transparent;
520 final boolean shouldDelayFirstAndroidViewDraw = renderMode == RenderMode.surface;
521 final boolean shouldAutomaticallyHandleOnBackPressed = true;
522
523 if (getCachedEngineId() != null) {
524 Log.v(
525 TAG,
526 "Creating FlutterFragment with cached engine:\n"
527 + "Cached engine ID: "
529 + "\n"
530 + "Will destroy engine when Activity is destroyed: "
532 + "\n"
533 + "Background transparency mode: "
534 + backgroundMode
535 + "\n"
536 + "Will attach FlutterEngine to Activity: "
538
539 return FlutterFragment.withCachedEngine(getCachedEngineId())
540 .renderMode(renderMode)
541 .transparencyMode(transparencyMode)
542 .handleDeeplinking(shouldHandleDeeplinking())
543 .shouldAttachEngineToActivity(shouldAttachEngineToActivity())
544 .destroyEngineWithFragment(shouldDestroyEngineWithHost())
545 .shouldDelayFirstAndroidViewDraw(shouldDelayFirstAndroidViewDraw)
546 .shouldAutomaticallyHandleOnBackPressed(shouldAutomaticallyHandleOnBackPressed)
547 .build();
548 } else {
549 Log.v(
550 TAG,
551 "Creating FlutterFragment with new engine:\n"
552 + "Cached engine group ID: "
554 + "\n"
555 + "Background transparency mode: "
556 + backgroundMode
557 + "\n"
558 + "Dart entrypoint: "
560 + "\n"
561 + "Dart entrypoint library uri: "
563 + "\n"
564 + "Initial route: "
566 + "\n"
567 + "App bundle path: "
569 + "\n"
570 + "Will attach FlutterEngine to Activity: "
572
573 if (getCachedEngineGroupId() != null) {
574 return FlutterFragment.withNewEngineInGroup(getCachedEngineGroupId())
575 .dartEntrypoint(getDartEntrypointFunctionName())
576 .initialRoute(getInitialRoute())
577 .handleDeeplinking(shouldHandleDeeplinking())
578 .renderMode(renderMode)
579 .transparencyMode(transparencyMode)
580 .shouldAttachEngineToActivity(shouldAttachEngineToActivity())
581 .shouldDelayFirstAndroidViewDraw(shouldDelayFirstAndroidViewDraw)
582 .shouldAutomaticallyHandleOnBackPressed(shouldAutomaticallyHandleOnBackPressed)
583 .build();
584 }
585
586 return FlutterFragment.withNewEngine()
587 .dartEntrypoint(getDartEntrypointFunctionName())
588 .dartLibraryUri(getDartEntrypointLibraryUri())
589 .dartEntrypointArgs(getDartEntrypointArgs())
590 .initialRoute(getInitialRoute())
591 .appBundlePath(getAppBundlePath())
592 .flutterShellArgs(FlutterShellArgs.fromIntent(getIntent()))
593 .handleDeeplinking(shouldHandleDeeplinking())
594 .renderMode(renderMode)
595 .transparencyMode(transparencyMode)
596 .shouldAttachEngineToActivity(shouldAttachEngineToActivity())
597 .shouldDelayFirstAndroidViewDraw(shouldDelayFirstAndroidViewDraw)
598 .shouldAutomaticallyHandleOnBackPressed(shouldAutomaticallyHandleOnBackPressed)
599 .build();
600 }
601 }
void Log(const char *format,...) SK_PRINTF_LIKE(1
Definition: TestRunner.cpp:137

◆ getAppBundlePath()

String io.flutter.embedding.android.FlutterFragmentActivity.getAppBundlePath ( )
inlineprotected

A custom path to the bundle that contains this Flutter app's resources, e.g., Dart code snapshots.

When this FlutterFragmentActivity is run by Flutter tooling and a data String is included in the launching Intent, that data String is interpreted as an app bundle path.

When otherwise unspecified, the value is null, which defaults to the app bundle path defined in io.flutter.embedding.engine.loader.FlutterLoader#findAppBundlePath().

Subclasses may override this method to return a custom app bundle path.

Definition at line 763 of file FlutterFragmentActivity.java.

763 {
764 // If this Activity was launched from tooling, and the incoming Intent contains
765 // a custom app bundle path, return that path.
766 // TODO(mattcarroll): determine if we should have an explicit FlutterTestActivity instead of
767 // conflating.
768 if (isDebuggable() && Intent.ACTION_RUN.equals(getIntent().getAction())) {
769 String appBundlePath = getIntent().getDataString();
770 if (appBundlePath != null) {
771 return appBundlePath;
772 }
773 }
774
775 return null;
776 }

◆ getBackgroundMode()

BackgroundMode io.flutter.embedding.android.FlutterFragmentActivity.getBackgroundMode ( )
inlineprotected

The desired window background mode of this Activity, which defaults to BackgroundMode#opaque.

Definition at line 905 of file FlutterFragmentActivity.java.

905 {
906 if (getIntent().hasExtra(EXTRA_BACKGROUND_MODE)) {
907 return BackgroundMode.valueOf(getIntent().getStringExtra(EXTRA_BACKGROUND_MODE));
908 } else {
909 return BackgroundMode.opaque;
910 }
911 }

◆ getCachedEngineGroupId()

String io.flutter.embedding.android.FlutterFragmentActivity.getCachedEngineGroupId ( )
inlineprotected

Definition at line 896 of file FlutterFragmentActivity.java.

896 {
897 return getIntent().getStringExtra(EXTRA_CACHED_ENGINE_GROUP_ID);
898 }

◆ getCachedEngineId()

String io.flutter.embedding.android.FlutterFragmentActivity.getCachedEngineId ( )
inlineprotected

Returns the ID of a statically cached io.flutter.embedding.engine.FlutterEngine to use within this FlutterFragmentActivity, or null if this
FlutterFragmentActivity
does not want to use a cached io.flutter.embedding.engine.FlutterEngine.

Definition at line 891 of file FlutterFragmentActivity.java.

891 {
892 return getIntent().getStringExtra(EXTRA_CACHED_ENGINE_ID);
893 }

◆ getDartEntrypointArgs()

List< String > io.flutter.embedding.android.FlutterFragmentActivity.getDartEntrypointArgs ( )
inline

The Dart entrypoint arguments will be passed as a list of string to Dart's entrypoint function.

A value of null means do not pass any arguments to Dart's entrypoint function.

Subclasses may override this method to directly control the Dart entrypoint arguments.

Definition at line 815 of file FlutterFragmentActivity.java.

815 {
816 return (List<String>) getIntent().getSerializableExtra(EXTRA_DART_ENTRYPOINT_ARGS);
817 }

◆ getDartEntrypointFunctionName()

String io.flutter.embedding.android.FlutterFragmentActivity.getDartEntrypointFunctionName ( )
inline

The Dart entrypoint that will be executed as soon as the Dart snapshot is loaded.

This preference can be controlled by setting a <meta-data> called FlutterActivityLaunchConfigs#DART_ENTRYPOINT_META_DATA_KEY within the Android manifest definition for this FlutterFragmentActivity.

Subclasses may override this method to directly control the Dart entrypoint.

Definition at line 796 of file FlutterFragmentActivity.java.

796 {
797 try {
798 Bundle metaData = getMetaData();
799 String desiredDartEntrypoint =
800 metaData != null ? metaData.getString(DART_ENTRYPOINT_META_DATA_KEY) : null;
801 return desiredDartEntrypoint != null ? desiredDartEntrypoint : DEFAULT_DART_ENTRYPOINT;
802 } catch (PackageManager.NameNotFoundException e) {
803 return DEFAULT_DART_ENTRYPOINT;
804 }
805 }

◆ getDartEntrypointLibraryUri()

String io.flutter.embedding.android.FlutterFragmentActivity.getDartEntrypointLibraryUri ( )
inline

The Dart library URI for the entrypoint that will be executed as soon as the Dart snapshot is loaded.

Example value: "package:foo/bar.dart"

This preference can be controlled by setting a <meta-data> called FlutterActivityLaunchConfigs#DART_ENTRYPOINT_URI_META_DATA_KEY within the Android manifest definition for this FlutterFragmentActivity.

A value of null means use the default root library.

Subclasses may override this method to directly control the Dart entrypoint uri.

Definition at line 834 of file FlutterFragmentActivity.java.

834 {
835 try {
836 Bundle metaData = getMetaData();
837 String desiredDartLibraryUri =
838 metaData != null ? metaData.getString(DART_ENTRYPOINT_URI_META_DATA_KEY) : null;
839 return desiredDartLibraryUri;
840 } catch (PackageManager.NameNotFoundException e) {
841 return null;
842 }
843 }

◆ getFlutterEngine()

FlutterEngine io.flutter.embedding.android.FlutterFragmentActivity.getFlutterEngine ( )
inlineprotected

Definition at line 650 of file FlutterFragmentActivity.java.

650 {
651 return flutterFragment.getFlutterEngine();
652 }

◆ getInitialRoute()

String io.flutter.embedding.android.FlutterFragmentActivity.getInitialRoute ( )
inlineprotected

The initial route that a Flutter app will render upon loading and executing its Dart code.

This preference can be controlled with 2 methods:

  1. Pass a boolean as FlutterActivityLaunchConfigs#EXTRA_INITIAL_ROUTE with the launching Intent, or
  2. Set a <meta-data> called FlutterActivityLaunchConfigs#INITIAL_ROUTE_META_DATA_KEY for this Activity in the Android manifest.

If both preferences are set, the Intent preference takes priority.

The reason that a <meta-data> preference is supported is because this
Activity
might be the very first Activity launched, which means the developer won't have control over the incoming Intent.

Subclasses may override this method to directly control the initial route.

If this method returns null and the shouldHandleDeeplinking returns true, the initial route is derived from the Intent through the Intent.getData() instead.

Definition at line 869 of file FlutterFragmentActivity.java.

869 {
870 if (getIntent().hasExtra(EXTRA_INITIAL_ROUTE)) {
871 return getIntent().getStringExtra(EXTRA_INITIAL_ROUTE);
872 }
873
874 try {
875 Bundle metaData = getMetaData();
876 String desiredInitialRoute =
877 metaData != null ? metaData.getString(INITIAL_ROUTE_META_DATA_KEY) : null;
878 return desiredInitialRoute;
879 } catch (PackageManager.NameNotFoundException e) {
880 return null;
881 }
882 }

◆ getMetaData()

Bundle io.flutter.embedding.android.FlutterFragmentActivity.getMetaData ( ) throws PackageManager.NameNotFoundException
inlineprotected

Retrieves the meta data specified in the AndroidManifest.xml.

Definition at line 780 of file FlutterFragmentActivity.java.

780 {
781 ActivityInfo activityInfo =
782 getPackageManager().getActivityInfo(getComponentName(), PackageManager.GET_META_DATA);
783 return activityInfo.metaData;
784 }

◆ getRenderMode()

RenderMode io.flutter.embedding.android.FlutterFragmentActivity.getRenderMode ( )
inlineprotected

Returns the desired RenderMode for the FlutterView displayed in this
FlutterFragmentActivity
.

That is, RenderMode#surface if FlutterFragmentActivity#getBackgroundMode() is BackgroundMode#opaque or RenderMode#texture otherwise.

Definition at line 921 of file FlutterFragmentActivity.java.

921 {
922 final BackgroundMode backgroundMode = getBackgroundMode();
923 return backgroundMode == BackgroundMode.opaque ? RenderMode.surface : RenderMode.texture;
924 }

◆ onActivityResult()

void io.flutter.embedding.android.FlutterFragmentActivity.onActivityResult ( int  requestCode,
int  resultCode,
Intent  data 
)
inlineprotected

Definition at line 643 of file FlutterFragmentActivity.java.

643 {
644 super.onActivityResult(requestCode, resultCode, data);
645 flutterFragment.onActivityResult(requestCode, resultCode, data);
646 }
void onActivityResult(int requestCode, int resultCode, Intent data)
std::shared_ptr< const fml::Mapping > data
Definition: texture_gles.cc:63

◆ onCreate()

void io.flutter.embedding.android.FlutterFragmentActivity.onCreate ( @Nullable Bundle  savedInstanceState)
inlineprotected

Definition at line 373 of file FlutterFragmentActivity.java.

373 {
374 switchLaunchThemeForNormalTheme();
375 // Get an existing fragment reference first before onCreate since onCreate would re-attach
376 // existing fragments. This would cause FlutterFragment to reference the host activity which
377 // should be aware of its child fragment.
379
380 super.onCreate(savedInstanceState);
381
382 configureWindowForTransparency();
383 setContentView(createFragmentContainer());
384 configureStatusBarForFullscreenFlutterExperience();
385 ensureFlutterFragmentCreated();
386 }

◆ onNewIntent()

void io.flutter.embedding.android.FlutterFragmentActivity.onNewIntent ( @NonNull Intent  intent)
inlineprotected

Definition at line 617 of file FlutterFragmentActivity.java.

617 {
618 // Forward Intents to our FlutterFragment in case it cares.
619 flutterFragment.onNewIntent(intent);
620 super.onNewIntent(intent);
621 }

◆ onPostResume()

void io.flutter.embedding.android.FlutterFragmentActivity.onPostResume ( )
inline

Definition at line 611 of file FlutterFragmentActivity.java.

611 {
612 super.onPostResume();
613 flutterFragment.onPostResume();
614 }

◆ onRequestPermissionsResult()

void io.flutter.embedding.android.FlutterFragmentActivity.onRequestPermissionsResult ( int  requestCode,
@NonNull String[]  permissions,
@NonNull int[]  grantResults 
)
inline

Definition at line 624 of file FlutterFragmentActivity.java.

625 {
626 super.onRequestPermissionsResult(requestCode, permissions, grantResults);
627 flutterFragment.onRequestPermissionsResult(requestCode, permissions, grantResults);
628 }
void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults)

◆ onTrimMemory()

void io.flutter.embedding.android.FlutterFragmentActivity.onTrimMemory ( int  level)
inline

Definition at line 637 of file FlutterFragmentActivity.java.

637 {
638 super.onTrimMemory(level);
639 flutterFragment.onTrimMemory(level);
640 }

◆ onUserLeaveHint()

void io.flutter.embedding.android.FlutterFragmentActivity.onUserLeaveHint ( )
inline

Definition at line 632 of file FlutterFragmentActivity.java.

632 {
633 flutterFragment.onUserLeaveHint();
634 }

◆ provideFlutterEngine()

FlutterEngine io.flutter.embedding.android.FlutterFragmentActivity.provideFlutterEngine ( @NonNull Context  context)
inline

Hook for subclasses to easily provide a custom FlutterEngine.

Implements io.flutter.embedding.android.FlutterEngineProvider.

Reimplemented in io.flutter.embedding.android.FlutterFragmentActivityTest.FlutterFragmentActivityWithProvidedEngine.

Definition at line 709 of file FlutterFragmentActivity.java.

709 {
710 // No-op. Hook for subclasses.
711 return null;
712 }

◆ provideRootLayout()

FrameLayout io.flutter.embedding.android.FlutterFragmentActivity.provideRootLayout ( Context  context)
inlineprotected

Returns a FrameLayout that is used as the content view of this activity.

Definition at line 937 of file FlutterFragmentActivity.java.

937 {
938 return new FrameLayout(context);
939 }

◆ retrieveExistingFlutterFragmentIfPossible()

FlutterFragment io.flutter.embedding.android.FlutterFragmentActivity.retrieveExistingFlutterFragmentIfPossible ( )
inlinepackage

Retrieves the previously created FlutterFragment if possible.

If the activity is recreated, an existing FlutterFragment may already exist. Retain a reference to that FlutterFragment in the #flutterFragment field and avoid re-creating another FlutterFragment.

Definition at line 476 of file FlutterFragmentActivity.java.

476 {
477 FragmentManager fragmentManager = getSupportFragmentManager();
478 return (FlutterFragment) fragmentManager.findFragmentByTag(TAG_FLUTTER_FRAGMENT);
479 }

◆ shouldAttachEngineToActivity()

boolean io.flutter.embedding.android.FlutterFragmentActivity.shouldAttachEngineToActivity ( )
inlineprotected

Hook for subclasses to control whether or not the FlutterFragment within this
Activity
automatically attaches its io.flutter.embedding.engine.FlutterEngine to this Activity.

For an explanation of why this control exists, see FlutterFragment.NewEngineFragmentBuilder#shouldAttachEngineToActivity().

This property is controlled with a protected method instead of an Intent argument because the only situation where changing this value would help, is a situation in which
FlutterFragmentActivity
is being subclassed to utilize a custom and/or cached FlutterEngine.

Defaults to true.

Definition at line 682 of file FlutterFragmentActivity.java.

682 {
683 return true;
684 }

◆ shouldDestroyEngineWithHost()

boolean io.flutter.embedding.android.FlutterFragmentActivity.shouldDestroyEngineWithHost ( )
inline

Returns false if the io.flutter.embedding.engine.FlutterEngine backing this
FlutterFragmentActivity
should outlive this FlutterFragmentActivity, or true to be destroyed when the FlutterFragmentActivity is destroyed.

The default value is true in cases where FlutterFragmentActivity created its own io.flutter.embedding.engine.FlutterEngine, and false in cases where a cached io.flutter.embedding.engine.FlutterEngine was provided.

Definition at line 663 of file FlutterFragmentActivity.java.

663 {
664 return getIntent().getBooleanExtra(EXTRA_DESTROY_ENGINE_WITH_ACTIVITY, false);
665 }

◆ shouldHandleDeeplinking()

boolean io.flutter.embedding.android.FlutterFragmentActivity.shouldHandleDeeplinking ( )
inlineprotected

Whether to handle the deeplinking from the Intent automatically if the
getInitialRoute
returns null.

The default implementation looks <meta-data> called FlutterActivityLaunchConfigs#HANDLE_DEEPLINKING_META_DATA_KEY within the Android manifest definition for this FlutterFragmentActivity.

Definition at line 695 of file FlutterFragmentActivity.java.

695 {
696 try {
697 Bundle metaData = getMetaData();
699 metaData != null ? metaData.getBoolean(HANDLE_DEEPLINKING_META_DATA_KEY) : false;
701 } catch (PackageManager.NameNotFoundException e) {
702 return false;
703 }
704 }

◆ withCachedEngine()

static CachedEngineIntentBuilder io.flutter.embedding.android.FlutterFragmentActivity.withCachedEngine ( @NonNull String  cachedEngineId)
inlinestatic

Creates a CachedEngineIntentBuilder, which can be used to configure an Intent to launch a FlutterFragmentActivity that internally uses an existing FlutterEngine that is cached in io.flutter.embedding.engine.FlutterEngineCache.

Definition at line 186 of file FlutterFragmentActivity.java.

186 {
187 return new CachedEngineIntentBuilder(FlutterFragmentActivity.class, cachedEngineId);
188 }

◆ withNewEngine()

static NewEngineIntentBuilder io.flutter.embedding.android.FlutterFragmentActivity.withNewEngine ( )
inlinestatic

Creates an FlutterFragmentActivity.NewEngineIntentBuilder, which can be used to configure an Intent to launch a FlutterFragmentActivity that internally creates a new io.flutter.embedding.engine.FlutterEngine using the desired Dart entrypoint, initial route, etc.

Definition at line 86 of file FlutterFragmentActivity.java.

86 {
87 return new NewEngineIntentBuilder(FlutterFragmentActivity.class);
88 }

◆ withNewEngineInGroup()

static NewEngineInGroupIntentBuilder io.flutter.embedding.android.FlutterFragmentActivity.withNewEngineInGroup ( @NonNull String  engineGroupId)
inlinestatic

Creates a NewEngineInGroupIntentBuilder, which can be used to configure an Intent to launch a FlutterFragmentActivity that internally uses an existing io.flutter.embedding.engine.FlutterEngineGroup that is cached in io.flutter.embedding.engine.FlutterEngineGroupCache.

Parameters
engineGroupIdA cached engine group ID.
Returns
The builder.

Definition at line 273 of file FlutterFragmentActivity.java.

273 {
274 return new NewEngineInGroupIntentBuilder(FlutterFragmentActivity.class, engineGroupId);
275 }

Member Data Documentation

◆ FRAGMENT_CONTAINER_ID

final int io.flutter.embedding.android.FlutterFragmentActivity.FRAGMENT_CONTAINER_ID = View.generateViewId()
static

Definition at line 68 of file FlutterFragmentActivity.java.


The documentation for this class was generated from the following file: