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 TypeMethodDescriptionvoidattachToContentProvider(ContentProvider contentProvider, androidx.lifecycle.Lifecycle lifecycle) Call this method from theContentProviderthat is running theFlutterEnginethat is associated with thisContentProviderControlSurface.voidCall this method from theContentProviderthat is attached to thisContentProviderControlSurfaces'sFlutterEnginewhen theContentProvideris about to be destroyed.
-
Method Details
-
attachToContentProvider
void attachToContentProvider(@NonNull ContentProvider contentProvider, @NonNull androidx.lifecycle.Lifecycle lifecycle) Call this method from theContentProviderthat is running theFlutterEnginethat is associated with thisContentProviderControlSurface.Once a
ContentProvideris created, and its associatedFlutterEngineis executing Dart code, theContentProvidershould invoke this method. At that point theFlutterEngineis considered "attached" to theContentProviderand allContentProviderAwareplugins are given access to theContentProvider. -
detachFromContentProvider
void detachFromContentProvider()Call this method from theContentProviderthat is attached to thisContentProviderControlSurfaces'sFlutterEnginewhen theContentProvideris about to be destroyed.This method gives each
ContentProviderAwareplugin an opportunity to clean up its references before theis destroyed.
-