diff --git a/sky/shell/platform/android/org/domokit/sky/shell/PlatformViewAndroid.java b/sky/shell/platform/android/org/domokit/sky/shell/PlatformViewAndroid.java index 149fedf1567..555b05ae282 100644 --- a/sky/shell/platform/android/org/domokit/sky/shell/PlatformViewAndroid.java +++ b/sky/shell/platform/android/org/domokit/sky/shell/PlatformViewAndroid.java @@ -131,8 +131,7 @@ public class PlatformViewAndroid extends SurfaceView { return mSkyEngine; } - @Override - protected void onDetachedFromWindow() { + void destroy() { getHolder().removeCallback(mSurfaceCallback); nativeDetach(mNativePlatformView); mNativePlatformView = 0; diff --git a/sky/shell/platform/android/org/domokit/sky/shell/SkyActivity.java b/sky/shell/platform/android/org/domokit/sky/shell/SkyActivity.java index 66f4ee63754..1e04230bb3a 100644 --- a/sky/shell/platform/android/org/domokit/sky/shell/SkyActivity.java +++ b/sky/shell/platform/android/org/domokit/sky/shell/SkyActivity.java @@ -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();