Interface BroadcastReceiverControlSurface
-
public interface BroadcastReceiverControlSurfaceControl surface through which aBroadcastReceiverattaches to aFlutterEngine.A
BroadcastReceiverthat contains aFlutterEngineshould coordinate itself with theFlutterEngine'sBroadcastReceiverControlSurface.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidattachToBroadcastReceiver(BroadcastReceiver broadcastReceiver, androidx.lifecycle.Lifecycle lifecycle)Call this method from theBroadcastReceiverthat is running theFlutterEnginethat is associated with thisBroadcastReceiverControlSurface.voiddetachFromBroadcastReceiver()Call this method from theBroadcastReceiverthat is attached to thisBroadcastReceiverControlSurfaces'sFlutterEnginewhen theBroadcastReceiveris about to be destroyed.
-
-
-
Method Detail
-
attachToBroadcastReceiver
void attachToBroadcastReceiver(@NonNull BroadcastReceiver broadcastReceiver, @NonNull androidx.lifecycle.Lifecycle lifecycle)Call this method from theBroadcastReceiverthat is running theFlutterEnginethat is associated with thisBroadcastReceiverControlSurface.Once a
BroadcastReceiveris created, and its associatedFlutterEngineis executing Dart code, theBroadcastReceivershould invoke this method. At that point theFlutterEngineis considered "attached" to theBroadcastReceiverand allBroadcastReceiverAwareplugins are given access to theBroadcastReceiver.
-
detachFromBroadcastReceiver
void detachFromBroadcastReceiver()
Call this method from theBroadcastReceiverthat is attached to thisBroadcastReceiverControlSurfaces'sFlutterEnginewhen theBroadcastReceiveris about to be destroyed.This method gives each
BroadcastReceiverAwareplugin an opportunity to clean up its references before theis destroyed.
-
-