Interface ContentProviderControlSurface
public interface ContentProviderControlSurface
Control surface through which a
ContentProvider
attaches to a FlutterEngine
.
A ContentProvider
that contains a FlutterEngine
should coordinate itself with the FlutterEngine
's
ContentProviderControlSurface
.
-
Method Summary
Modifier and TypeMethodDescriptionvoid
attachToContentProvider
(ContentProvider contentProvider, androidx.lifecycle.Lifecycle lifecycle) Call this method from theContentProvider
that is running theFlutterEngine
that is associated with thisContentProviderControlSurface
.void
Call this method from theContentProvider
that is attached to thisContentProviderControlSurfaces
'sFlutterEngine
when theContentProvider
is about to be destroyed.
-
Method Details
-
attachToContentProvider
void attachToContentProvider(@NonNull ContentProvider contentProvider, @NonNull androidx.lifecycle.Lifecycle lifecycle) Call this method from theContentProvider
that is running theFlutterEngine
that is associated with thisContentProviderControlSurface
.Once a
ContentProvider
is created, and its associatedFlutterEngine
is executing Dart code, theContentProvider
should invoke this method. At that point theFlutterEngine
is considered "attached" to theContentProvider
and allContentProviderAware
plugins are given access to theContentProvider
. -
detachFromContentProvider
void detachFromContentProvider()Call this method from theContentProvider
that is attached to thisContentProviderControlSurfaces
'sFlutterEngine
when theContentProvider
is about to be destroyed.This method gives each
ContentProviderAware
plugin an opportunity to clean up its references before theis destroyed
.
-