mirror of
https://github.com/flutter/flutter.git
synced 2026-02-20 02:29:02 +08:00
Don't destory the engine when detaching from the window
Reading the Android docs, it sounds like an android.view.View can re-attach to the window after detaching. Previously, we destroyed the engine when we detached from the window. Now we wait for the activity to be destroyed. Hopefully fixes #997
This commit is contained in:
parent
6ed78c58e0
commit
241fc21055
@ -131,8 +131,7 @@ public class PlatformViewAndroid extends SurfaceView {
|
||||
return mSkyEngine;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDetachedFromWindow() {
|
||||
void destroy() {
|
||||
getHolder().removeCallback(mSurfaceCallback);
|
||||
nativeDetach(mNativePlatformView);
|
||||
mNativePlatformView = 0;
|
||||
|
||||
@ -86,6 +86,9 @@ public class SkyActivity extends Activity {
|
||||
*/
|
||||
@Override
|
||||
protected void onDestroy() {
|
||||
if (mView != null) {
|
||||
mView.destroy();
|
||||
}
|
||||
// Do we need to shut down Sky too?
|
||||
mTracingController.stop();
|
||||
super.onDestroy();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user