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 149fedf15671ffcc65d6154792d80629d6c3335a..555b05ae28207ebe73653579dcc98bf03e374969 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 66f4ee637544376336a5c49d8edb3b53d26baee6..1e04230bb3aeb4ba692619d6d2aded2f7e05b4aa 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();