Class FlutterActivityDelegate
- java.lang.Object
-
- io.flutter.app.FlutterActivityDelegate
-
- All Implemented Interfaces:
ComponentCallbacks,ComponentCallbacks2,FlutterActivityEvents,PluginRegistry,PluginRegistry.ActivityResultListener,PluginRegistry.RequestPermissionsResultListener,FlutterView.Provider
@Deprecated public final class FlutterActivityDelegate extends Object implements FlutterActivityEvents, FlutterView.Provider, PluginRegistry
Deprecated.FlutterActivityis the new API that now replaces this class andFlutterActivity. See https://flutter.dev/go/android-project-migration for more migration details.Deprecated class that performs the actual work of tying AndroidActivityinstances to Flutter.This exists as a dedicated class (as opposed to being integrated directly into
FlutterActivity) to facilitate applications that don't wish to subclassFlutterActivity. The most obvious example of when this may come in handy is if an application wishes to subclass the Android v4 support library'sFragmentActivity.Usage:
To wire this class up to your activity, simply forward the events defined in
FlutterActivityEventsfrom your activity to an instance of this class. Optionally, you can make your activity implementPluginRegistryand/orFlutterView.Providerand forward those methods to this class as well.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interfaceFlutterActivityDelegate.ViewFactoryDeprecated.Specifies the mechanism by which Flutter views are created during the operation of aFlutterActivityDelegate.-
Nested classes/interfaces inherited from interface io.flutter.plugin.common.PluginRegistry
PluginRegistry.ActivityResultListener, PluginRegistry.NewIntentListener, PluginRegistry.PluginRegistrantCallback, PluginRegistry.Registrar, PluginRegistry.RequestPermissionsResultListener, PluginRegistry.UserLeaveHintListener, PluginRegistry.ViewDestroyListener
-
-
Field Summary
-
Fields inherited from interface android.content.ComponentCallbacks2
TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
-
-
Constructor Summary
Constructors Constructor Description FlutterActivityDelegate(Activity activity, FlutterActivityDelegate.ViewFactory viewFactory)Deprecated.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description FlutterViewgetFlutterView()Deprecated.Returns a reference to the Flutter view maintained by this object.booleanhasPlugin(String key)Deprecated.Returns whether the specified plugin is known to this registry.booleanonActivityResult(int requestCode, int resultCode, Intent data)Deprecated.booleanonBackPressed()Deprecated.Invoked when the activity has detected the user's press of the back key.voidonConfigurationChanged(Configuration newConfig)Deprecated.voidonCreate(Bundle savedInstanceState)Deprecated.voidonDestroy()Deprecated.voidonLowMemory()Deprecated.voidonNewIntent(Intent intent)Deprecated.voidonPause()Deprecated.voidonPostResume()Deprecated.booleanonRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)Deprecated.voidonResume()Deprecated.voidonStart()Deprecated.voidonStop()Deprecated.voidonTrimMemory(int level)Deprecated.voidonUserLeaveHint()Deprecated.PluginRegistry.RegistrarregistrarFor(String pluginKey)Deprecated.Returns aPluginRegistry.Registrarfor receiving the registrations pertaining to the specified plugin.<T> TvaluePublishedByPlugin(String pluginKey)Deprecated.Returns the value published by the specified plugin, if any.
-
-
-
Constructor Detail
-
FlutterActivityDelegate
public FlutterActivityDelegate(Activity activity, FlutterActivityDelegate.ViewFactory viewFactory)
Deprecated.
-
-
Method Detail
-
getFlutterView
public FlutterView getFlutterView()
Deprecated.Description copied from interface:FlutterView.ProviderReturns a reference to the Flutter view maintained by this object. This may benull.- Specified by:
getFlutterViewin interfaceFlutterView.Provider- Returns:
- a reference to the Flutter view maintained by this object.
-
hasPlugin
public boolean hasPlugin(String key)
Deprecated.Description copied from interface:PluginRegistryReturns whether the specified plugin is known to this registry.- Specified by:
hasPluginin interfacePluginRegistry- Parameters:
key- a unique String identifying the plugin; typically the fully qualified name of the plugin's main class.- Returns:
- true if this registry has handed out a registrar for the specified plugin.
-
valuePublishedByPlugin
public <T> T valuePublishedByPlugin(String pluginKey)
Deprecated.Description copied from interface:PluginRegistryReturns the value published by the specified plugin, if any.Plugins may publish a single value, such as an instance of the plugin's main class, for situations where external control or interaction is needed. Clients are expected to know the value's type.
- Specified by:
valuePublishedByPluginin interfacePluginRegistry- Type Parameters:
T- The type of the value.- Parameters:
pluginKey- a unique String identifying the plugin; typically the fully qualified name of the plugin's main class.- Returns:
- the published value, possibly null.
-
registrarFor
public PluginRegistry.Registrar registrarFor(String pluginKey)
Deprecated.Description copied from interface:PluginRegistryReturns aPluginRegistry.Registrarfor receiving the registrations pertaining to the specified plugin.- Specified by:
registrarForin interfacePluginRegistry- Parameters:
pluginKey- a unique String identifying the plugin; typically the fully qualified name of the plugin's main class.- Returns:
- A
PluginRegistry.Registrarfor receiving the registrations pertianing to the specified plugin.
-
onRequestPermissionsResult
public boolean onRequestPermissionsResult(int requestCode, String[] permissions, int[] grantResults)Deprecated.- Specified by:
onRequestPermissionsResultin interfacePluginRegistry.RequestPermissionsResultListener- Parameters:
requestCode- The request code passed inActivityCompat.requestPermissions(android.app.Activity, String[], int).permissions- The requested permissions.grantResults- The grant results for the corresponding permissions which is eitherPackageManager.PERMISSION_GRANTEDorPackageManager.PERMISSION_DENIED.- Returns:
- true if the result has been handled.
-
onActivityResult
public boolean onActivityResult(int requestCode, int resultCode, Intent data)Deprecated.- Specified by:
onActivityResultin interfacePluginRegistry.ActivityResultListener- Parameters:
requestCode- The integer request code originally supplied tostartActivityForResult(), allowing you to identify who this result came from.resultCode- The integer result code returned by the child activity through itssetResult().data- An Intent, which can return result data to the caller (various data can be attached to Intent "extras").- Returns:
- true if the result has been handled.
-
onCreate
public void onCreate(Bundle savedInstanceState)
Deprecated.- Specified by:
onCreatein interfaceFlutterActivityEvents- Parameters:
savedInstanceState- If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied inonSaveInstanceState(Bundle).- See Also:
Activity.onCreate(android.os.Bundle)
-
onNewIntent
public void onNewIntent(Intent intent)
Deprecated.- Specified by:
onNewIntentin interfaceFlutterActivityEvents- Parameters:
intent- The new intent that was started for the activity.- See Also:
Activity.onNewIntent(Intent)
-
onPause
public void onPause()
Deprecated.- Specified by:
onPausein interfaceFlutterActivityEvents- See Also:
Activity.onPause()
-
onStart
public void onStart()
Deprecated.- Specified by:
onStartin interfaceFlutterActivityEvents- See Also:
Activity.onStart()
-
onResume
public void onResume()
Deprecated.- Specified by:
onResumein interfaceFlutterActivityEvents- See Also:
Activity.onResume()
-
onStop
public void onStop()
Deprecated.- Specified by:
onStopin interfaceFlutterActivityEvents- See Also:
Activity.onStop()
-
onPostResume
public void onPostResume()
Deprecated.- Specified by:
onPostResumein interfaceFlutterActivityEvents- See Also:
Activity.onPostResume()
-
onDestroy
public void onDestroy()
Deprecated.- Specified by:
onDestroyin interfaceFlutterActivityEvents- See Also:
Activity.onDestroy()
-
onBackPressed
public boolean onBackPressed()
Deprecated.Description copied from interface:FlutterActivityEventsInvoked when the activity has detected the user's press of the back key.- Specified by:
onBackPressedin interfaceFlutterActivityEvents- Returns:
trueif the listener handled the event;falseto let the activity continue with its default back button handling.- See Also:
Activity.onBackPressed()
-
onUserLeaveHint
public void onUserLeaveHint()
Deprecated.- Specified by:
onUserLeaveHintin interfaceFlutterActivityEvents- See Also:
Activity.onUserLeaveHint()
-
onTrimMemory
public void onTrimMemory(int level)
Deprecated.- Specified by:
onTrimMemoryin interfaceComponentCallbacks2
-
onLowMemory
public void onLowMemory()
Deprecated.- Specified by:
onLowMemoryin interfaceComponentCallbacks
-
onConfigurationChanged
public void onConfigurationChanged(Configuration newConfig)
Deprecated.- Specified by:
onConfigurationChangedin interfaceComponentCallbacks
-
-