Index: platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerActivity.java |
diff --git a/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerActivity.java b/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerActivity.java |
index e3260c25f7389dbec24cca19be0773510d1251dd..d6fe710aeb0fa8fa0f8a3b9daf2f8f11886de67b 100644 |
--- a/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerActivity.java |
+++ b/platform_tools/android/apps/viewer/src/main/java/org/skia/viewer/ViewerActivity.java |
@@ -60,6 +60,7 @@ public class ViewerActivity |
setContentView(R.layout.activity_main); |
mApplication = (ViewerApplication) getApplication(); |
+ mApplication.setViewerActivity(this); |
mView = (SurfaceView) findViewById(R.id.surfaceView); |
mView.getHolder().addCallback(this); |
@@ -67,6 +68,12 @@ public class ViewerActivity |
} |
@Override |
+ protected void onDestroy() { |
+ mApplication.setViewerActivity(null); |
+ super.onDestroy(); |
+ } |
+ |
+ @Override |
public void surfaceCreated(SurfaceHolder holder) { |
if (mApplication.getNativeHandle() != 0) { |
onSurfaceCreated(mApplication.getNativeHandle(), holder.getSurface()); |