Interface ActivityPluginBinding
-
public interface ActivityPluginBinding
Binding that givesActivityAware
plugins access to an associatedActivity
and theActivity
's lifecycle methods.To obtain an instance of an
ActivityPluginBinding
in a Flutter plugin, implement theActivityAware
interface. A binding is provided inActivityAware.onAttachedToActivity(ActivityPluginBinding)
andActivityAware.onReattachedToActivityForConfigChanges(ActivityPluginBinding)
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interface
ActivityPluginBinding.OnSaveInstanceStateListener
-
Method Summary
-
-
-
Method Detail
-
getActivity
@NonNull Activity getActivity()
Returns theActivity
that is currently attached to theFlutterEngine
that owns thisActivityPluginBinding
.
-
getLifecycle
@NonNull Object getLifecycle()
Returns theLifecycle
associated with the attachedActivity
.Use the flutter_plugin_android_lifecycle plugin to turn the returned
Object
into aLifecycle
object. See (https://github.com/flutter/plugins/tree/master/packages/flutter_plugin_android_lifecycle). Flutter plugins that rely onLifecycle
are forced to use the flutter_plugin_android_lifecycle plugin so that the version of the Android Lifecycle library is exposed to pub, which allows Flutter to manage different versions library over time.
-
addRequestPermissionsResultListener
void addRequestPermissionsResultListener(@NonNull PluginRegistry.RequestPermissionsResultListener listener)
Adds a listener that is invoked whenever the associatedActivity
'sonRequestPermissionsResult(...)
method is invoked.
-
removeRequestPermissionsResultListener
void removeRequestPermissionsResultListener(@NonNull PluginRegistry.RequestPermissionsResultListener listener)
Removes a listener that was added inaddRequestPermissionsResultListener(PluginRegistry.RequestPermissionsResultListener)
.
-
addActivityResultListener
void addActivityResultListener(@NonNull PluginRegistry.ActivityResultListener listener)
Adds a listener that is invoked whenever the associatedActivity
'sonActivityResult(...)
method is invoked.
-
removeActivityResultListener
void removeActivityResultListener(@NonNull PluginRegistry.ActivityResultListener listener)
Removes a listener that was added inaddActivityResultListener(PluginRegistry.ActivityResultListener)
.
-
addOnNewIntentListener
void addOnNewIntentListener(@NonNull PluginRegistry.NewIntentListener listener)
Adds a listener that is invoked whenever the associatedActivity
'sonNewIntent(...)
method is invoked.
-
removeOnNewIntentListener
void removeOnNewIntentListener(@NonNull PluginRegistry.NewIntentListener listener)
Removes a listener that was added inaddOnNewIntentListener(PluginRegistry.NewIntentListener)
.
-
addOnUserLeaveHintListener
void addOnUserLeaveHintListener(@NonNull PluginRegistry.UserLeaveHintListener listener)
Adds a listener that is invoked whenever the associatedActivity
'sonUserLeaveHint()
method is invoked.
-
removeOnUserLeaveHintListener
void removeOnUserLeaveHintListener(@NonNull PluginRegistry.UserLeaveHintListener listener)
Removes a listener that was added inaddOnUserLeaveHintListener(PluginRegistry.UserLeaveHintListener)
.
-
addOnSaveStateListener
void addOnSaveStateListener(@NonNull ActivityPluginBinding.OnSaveInstanceStateListener listener)
Adds a listener that is invoked when the associatedActivity
orFragment
saves and restores instance state.
-
removeOnSaveStateListener
void removeOnSaveStateListener(@NonNull ActivityPluginBinding.OnSaveInstanceStateListener listener)
Removes a listener that was added inaddOnSaveStateListener(OnSaveInstanceStateListener)
.
-
-