Package io.flutter.app

## 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.
  `FlutterActivity` is the new API that now replaces this class and `FlutterActivity`. See https://flutter.dev/go/android-project-migration for more migration details.
  Deprecated class that performs the actual work of tying Android `Activity` instances to Flutter.

  This exists as a dedicated class (as opposed to being integrated directly into `FlutterActivity`) to facilitate applications that don't wish to subclass `FlutterActivity`. The most obvious example of when this may come in handy is if an application wishes to subclass the Android v4 support library's `FragmentActivity`.

  Usage:

  To wire this class up to your activity, simply forward the events defined in `FlutterActivityEvents` from your activity to an instance of this class. Optionally, you can make your activity implement `PluginRegistry` and/or `FlutterView.Provider` and forward those methods to this class as well.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class | Description
    --- | --- | ---
    `static interface` | `FlutterActivityDelegate.ViewFactory` | Deprecated. Specifies the mechanism by which Flutter views are created during the operation of a `FlutterActivityDelegate`.

    - ### 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, PluginRegistry.WindowFocusChangedListener`

  - ### 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
    --- | --- | ---
    `FlutterView` | `getFlutterView()` | Deprecated. Returns a reference to the Flutter view maintained by this object.
    `boolean` | `hasPlugin​(String key)` | Deprecated. Returns whether the specified plugin is known to this registry.
    `boolean` | `onActivityResult​(int requestCode, int resultCode, Intent data)` | Deprecated.
    `boolean` | `onBackPressed()` | Deprecated. Invoked when the activity has detected the user's press of the back key.
    `void` | `onConfigurationChanged​(Configuration newConfig)` | Deprecated.
    `void` | `onCreate​(Bundle savedInstanceState)` | Deprecated.
    `void` | `onDestroy()` | Deprecated.
    `void` | `onLowMemory()` | Deprecated.
    `void` | `onNewIntent​(Intent intent)` | Deprecated.
    `void` | `onPause()` | Deprecated.
    `void` | `onPostResume()` | Deprecated.
    `boolean` | `onRequestPermissionsResult​(int requestCode, String[] permissions, int[] grantResults)` | Deprecated.
    `void` | `onResume()` | Deprecated.
    `void` | `onStart()` | Deprecated.
    `void` | `onStop()` | Deprecated.
    `void` | `onTrimMemory​(int level)` | Deprecated.
    `void` | `onUserLeaveHint()` | Deprecated.
    `void` | `onWindowFocusChanged​(boolean hasFocus)` | Deprecated.
    `PluginRegistry.Registrar` | `registrarFor​(String pluginKey)` | Deprecated. Returns a `PluginRegistry.Registrar` for receiving the registrations pertaining to the specified plugin.
    `<T> T` | `valuePublishedByPlugin​(String pluginKey)` | Deprecated. Returns the value published by the specified plugin, if any.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### FlutterActivityDelegate

          public FlutterActivityDelegate​(Activity activity,
                                         FlutterActivityDelegate.ViewFactory viewFactory)

      Deprecated.

  - ### Method Detail

    - #### getFlutterView

          public FlutterView getFlutterView()

      Deprecated.
      Description copied from interface: `FlutterView.Provider`
      Returns a reference to the Flutter view maintained by this object. This may be `null`.
      Specified by:
        `getFlutterView` in interface `FlutterView.Provider`
      Returns:
        a reference to the Flutter view maintained by this object.

    - #### hasPlugin

          public boolean hasPlugin​(String key)

      Deprecated.
      Description copied from interface: `PluginRegistry`
      Returns whether the specified plugin is known to this registry.
      Specified by:
        `hasPlugin` in interface `PluginRegistry`
      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: `PluginRegistry`
      Returns 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:
        `valuePublishedByPlugin` in interface `PluginRegistry`
      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: `PluginRegistry`
      Returns a `PluginRegistry.Registrar` for receiving the registrations pertaining to the specified plugin.
      Specified by:
        `registrarFor` in interface `PluginRegistry`
      Parameters:
        `pluginKey` - a unique String identifying the plugin; typically the fully qualified name of the plugin's main class.
      Returns:
        A `PluginRegistry.Registrar` for receiving the registrations pertianing to the specified plugin.

    - #### onRequestPermissionsResult

          public boolean onRequestPermissionsResult​(int requestCode,
                                                    String[] permissions,
                                                    int[] grantResults)

      Deprecated.
      Specified by:
        `onRequestPermissionsResult` in interface `PluginRegistry.RequestPermissionsResultListener`
      Parameters:
        `requestCode` - The request code passed in `ActivityCompat.requestPermissions(android.app.Activity, String[], int)`.
        `permissions` - The requested permissions.
        `grantResults` - The grant results for the corresponding permissions which is either `PackageManager.PERMISSION_GRANTED` or `PackageManager.PERMISSION_DENIED`.
      Returns:
        true if the result has been handled.

    - #### onActivityResult

          public boolean onActivityResult​(int requestCode,
                                          int resultCode,
                                          Intent data)

      Deprecated.
      Specified by:
        `onActivityResult` in interface `PluginRegistry.ActivityResultListener`
      Parameters:
        `requestCode` - The integer request code originally supplied to `startActivityForResult()`, allowing you to identify who this result came from.
        `resultCode` - The integer result code returned by the child activity through its `setResult()`.
        `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:
        `onCreate` in interface `FlutterActivityEvents`
      Parameters:
        `savedInstanceState` - If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in `onSaveInstanceState(Bundle)`.
      See Also:
        `Activity.onCreate(android.os.Bundle)`

    - #### onNewIntent

          public void onNewIntent​(Intent intent)

      Deprecated.
      Specified by:
        `onNewIntent` in interface `FlutterActivityEvents`
      Parameters:
        `intent` - The new intent that was started for the activity.
      See Also:
        `Activity.onNewIntent(Intent)`

    - #### onPause

          public void onPause()

      Deprecated.
      Specified by:
        `onPause` in interface `FlutterActivityEvents`
      See Also:
        `Activity.onPause()`

    - #### onStart

          public void onStart()

      Deprecated.
      Specified by:
        `onStart` in interface `FlutterActivityEvents`
      See Also:
        `Activity.onStart()`

    - #### onResume

          public void onResume()

      Deprecated.
      Specified by:
        `onResume` in interface `FlutterActivityEvents`
      See Also:
        `Activity.onResume()`

    - #### onStop

          public void onStop()

      Deprecated.
      Specified by:
        `onStop` in interface `FlutterActivityEvents`
      See Also:
        `Activity.onStop()`

    - #### onPostResume

          public void onPostResume()

      Deprecated.
      Specified by:
        `onPostResume` in interface `FlutterActivityEvents`
      See Also:
        `Activity.onPostResume()`

    - #### onDestroy

          public void onDestroy()

      Deprecated.
      Specified by:
        `onDestroy` in interface `FlutterActivityEvents`
      See Also:
        `Activity.onDestroy()`

    - #### onBackPressed

          public boolean onBackPressed()

      Deprecated.
      Description copied from interface: `FlutterActivityEvents`
      Invoked when the activity has detected the user's press of the back key.
      Specified by:
        `onBackPressed` in interface `FlutterActivityEvents`
      Returns:
        `true` if the listener handled the event; `false` to let the activity continue with its default back button handling.
      See Also:
        `Activity.onBackPressed()`

    - #### onUserLeaveHint

          public void onUserLeaveHint()

      Deprecated.
      Specified by:
        `onUserLeaveHint` in interface `FlutterActivityEvents`
      See Also:
        `Activity.onUserLeaveHint()`

    - #### onWindowFocusChanged

          public void onWindowFocusChanged​(boolean hasFocus)

      Deprecated.
      Specified by:
        `onWindowFocusChanged` in interface `FlutterActivityEvents`
      Parameters:
        `hasFocus` - True if the current activity window has focus.
      See Also:
        `Activity.onWindowFocusChanged(boolean)`

    - #### onTrimMemory

          public void onTrimMemory​(int level)

      Deprecated.
      Specified by:
        `onTrimMemory` in interface `ComponentCallbacks2`

    - #### onLowMemory

          public void onLowMemory()

      Deprecated.
      Specified by:
        `onLowMemory` in interface `ComponentCallbacks`

    - #### onConfigurationChanged

          public void onConfigurationChanged​(Configuration newConfig)

      Deprecated.
      Specified by:
        `onConfigurationChanged` in interface `ComponentCallbacks`