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 a
FlutterActivityDelegate
.
A delegate's view factory will be consulted during FlutterActivityDelegate.onCreate(Bundle)
. If it returns
null
, then the delegate will fall back to instantiating a new full-screen
FlutterView
.
A delegate's native view factory will be consulted during FlutterActivityDelegate.onCreate(Bundle)
. If it
returns null
, then the delegate will fall back to instantiating a new
FlutterNativeView
. This is useful for applications to override to reuse the FlutterNativeView
held e.g. by a pre-existing background service.
-
Method Summary
Modifier and TypeMethodDescriptioncreateFlutterView
(Context context) boolean
Hook for subclasses to indicate that theFlutterNativeView
returned bycreateFlutterNativeView()
should not be destroyed when this activity is destroyed.
-
Method Details
-
createFlutterView
-
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.
-