Interface BroadcastReceiverControlSurface
-
public interface BroadcastReceiverControlSurface
Control surface through which aBroadcastReceiver
attaches to aFlutterEngine
.A
BroadcastReceiver
that contains aFlutterEngine
should coordinate itself with theFlutterEngine
'sBroadcastReceiverControlSurface
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
attachToBroadcastReceiver(BroadcastReceiver broadcastReceiver, androidx.lifecycle.Lifecycle lifecycle)
Call this method from theBroadcastReceiver
that is running theFlutterEngine
that is associated with thisBroadcastReceiverControlSurface
.void
detachFromBroadcastReceiver()
Call this method from theBroadcastReceiver
that is attached to thisBroadcastReceiverControlSurfaces
'sFlutterEngine
when theBroadcastReceiver
is about to be destroyed.
-
-
-
Method Detail
-
attachToBroadcastReceiver
void attachToBroadcastReceiver(@NonNull BroadcastReceiver broadcastReceiver, @NonNull androidx.lifecycle.Lifecycle lifecycle)
Call this method from theBroadcastReceiver
that is running theFlutterEngine
that is associated with thisBroadcastReceiverControlSurface
.Once a
BroadcastReceiver
is created, and its associatedFlutterEngine
is executing Dart code, theBroadcastReceiver
should invoke this method. At that point theFlutterEngine
is considered "attached" to theBroadcastReceiver
and allBroadcastReceiverAware
plugins are given access to theBroadcastReceiver
.
-
detachFromBroadcastReceiver
void detachFromBroadcastReceiver()
Call this method from theBroadcastReceiver
that is attached to thisBroadcastReceiverControlSurfaces
'sFlutterEngine
when theBroadcastReceiver
is about to be destroyed.This method gives each
BroadcastReceiverAware
plugin an opportunity to clean up its references before theis destroyed
.
-
-