xster
changed the title
Let FlutterActivity subclasses detach from engine
Enforce exclusivity for activity and fragments attached to the FlutterEngine
| super.onDestroy(); | ||
| delegate.onDestroyView(); | ||
| delegate.onDetach(); | ||
| Log.e("meh", "Activity " + this + " onDestroy"); |
| Log.v(TAG, "FlutterActivity " + this + " onDestroy called after release."); | ||
| } | ||
| lifecycle.handleLifecycleEvent(Lifecycle.Event.ON_DESTROY); | ||
| } |
| "FlutterActivityAndFragmentDelegate's getAppComponent should only " | ||
| + "be queried after onAttach, when the host's activity should always be non-null"); | ||
| } | ||
| return host.getActivity(); |
| // -------- Start ActivityControlSurface ------- | ||
| private boolean isAttachedToActivity() { | ||
| return activity != null; | ||
| return activity != null || exclusiveActivity != null; |
| // If we were already attached to an Android component, detach from it. | ||
| detachFromAndroidComponent(); | ||
| if (this.exclusiveActivity != null) { | ||
| this.exclusiveActivity.detachFromFlutterEngine(); |
| * avoid situations where multiple activities are driving the FlutterEngine simultaneously. | ||
| * See https://github.com/flutter/flutter/issues/66192. | ||
| */ | ||
| @Deprecated |
xster
mentioned this pull request
Merged
| protected void onNewIntent(@NonNull Intent intent) { | ||
| // TODO(mattcarroll): change G3 lint rule that forces us to call super | ||
| super.onNewIntent(intent); | ||
| ensureAlive(); |