From 48df08e088c4ccef57025740c3f4be26ac5f56f9 Mon Sep 17 00:00:00 2001 From: Ari Weiland Date: Tue, 6 Apr 2021 02:04:46 -0400 Subject: [PATCH] Update FlutterFragment to implement ComponentCallbacks2. (flutter/engine#25428) --- .../io/flutter/embedding/android/FlutterFragment.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragment.java b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragment.java index db64d5ab23..91d673079a 100644 --- a/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragment.java +++ b/engine/src/flutter/shell/platform/android/io/flutter/embedding/android/FlutterFragment.java @@ -5,6 +5,7 @@ package io.flutter.embedding.android; import android.app.Activity; +import android.content.ComponentCallbacks2; import android.content.Context; import android.content.Intent; import android.os.Bundle; @@ -35,7 +36,6 @@ import io.flutter.plugin.platform.PlatformPlugin; *
  • {@link #onRequestPermissionsResult(int, String[], int[])} ()} *
  • {@link #onNewIntent(Intent)} ()} *
  • {@link #onUserLeaveHint()} - *
  • {@link #onTrimMemory(int)} * * * Additionally, when starting an {@code Activity} for a result from this {@code Fragment}, be sure @@ -81,7 +81,8 @@ import io.flutter.plugin.platform.PlatformPlugin; * FlutterView}. Using a {@link FlutterView} requires forwarding some calls from an {@code * Activity}, as well as forwarding lifecycle calls from an {@code Activity} or a {@code Fragment}. */ -public class FlutterFragment extends Fragment implements FlutterActivityAndFragmentDelegate.Host { +public class FlutterFragment extends Fragment + implements FlutterActivityAndFragmentDelegate.Host, ComponentCallbacks2 { private static final String TAG = "FlutterFragment"; /** The Dart entrypoint method name that is executed upon initialization. */ @@ -791,7 +792,7 @@ public class FlutterFragment extends Fragment implements FlutterActivityAndFragm * * @param level level */ - @ActivityCallThrough + @Override public void onTrimMemory(int level) { if (stillAttachedForEvent("onTrimMemory")) { delegate.onTrimMemory(level);