Package io.flutter.app
Interface FlutterActivityDelegate.ViewFactory
-
- All Known Implementing Classes:
FlutterActivity
,FlutterFragmentActivity
- Enclosing class:
- FlutterActivityDelegate
public static interface FlutterActivityDelegate.ViewFactory
Specifies the mechanism by which Flutter views are created during the operation of aFlutterActivityDelegate
.A delegate's view factory will be consulted during
FlutterActivityDelegate.onCreate(Bundle)
. If it returnsnull
, then the delegate will fall back to instantiating a new full-screenFlutterView
.A delegate's native view factory will be consulted during
FlutterActivityDelegate.onCreate(Bundle)
. If it returnsnull
, then the delegate will fall back to instantiating a newFlutterNativeView
. This is useful for applications to override to reuse the FlutterNativeView held e.g. by a pre-existing background service.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description FlutterNativeView
createFlutterNativeView()
FlutterView
createFlutterView(Context context)
boolean
retainFlutterNativeView()
Hook for subclasses to indicate that theFlutterNativeView
returned bycreateFlutterNativeView()
should not be destroyed when this activity is destroyed.
-
-
-
Method Detail
-
createFlutterView
FlutterView createFlutterView(Context context)
-
createFlutterNativeView
FlutterNativeView createFlutterNativeView()
-
retainFlutterNativeView
boolean retainFlutterNativeView()
Hook for subclasses to indicate that theFlutterNativeView
returned bycreateFlutterNativeView()
should not be destroyed when this activity is destroyed.- Returns:
- Whether the FlutterNativeView is retained.
-
-