Android Embedding PR28: Report app is active to Flutter in FlutterFragment.onResume() instead of onPostResume() forwarded from Activity. (flutter/engine#8536)

This commit is contained in:
Matt Carroll
2019-04-10 17:47:56 -07:00
committed by GitHub
parent b3e91cb003
commit 0e05ad325d

View File

@@ -442,12 +442,16 @@ public class FlutterFragment extends Fragment {
return FlutterView.TransparencyMode.valueOf(transparencyModeName);
}
@Override
public void onResume() {
super.onResume();
flutterEngine.getLifecycleChannel().appIsResumed();
}
// TODO(mattcarroll): determine why this can't be in onResume(). Comment reason, or move if possible.
public void onPostResume() {
Log.d(TAG, "onPostResume()");
if (flutterEngine != null) {
flutterEngine.getLifecycleChannel().appIsResumed();
// TODO(mattcarroll): find a better way to handle the update of UI overlays than calling through
// to platformPlugin. We're implicitly entangling the Window, Activity, Fragment,
// and engine all with this one call.