File tree Expand file tree Collapse file tree 2 files changed +8
-7
lines changed
worldwind-examples/src/main/java/gov/nasa/worldwindx
worldwind/src/main/java/gov/nasa/worldwind Expand file tree Collapse file tree 2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -61,13 +61,15 @@ protected void onPause() {
6161 super .onPause ();
6262 // Stop running the animation when this activity is paused.
6363 this .activityPaused = true ;
64+ this .lastFrameTimeNanos = 0 ;
6465 }
6566
6667 @ Override
6768 protected void onResume () {
6869 super .onResume ();
6970 // Resume the Navigator animation.
7071 this .activityPaused = false ;
72+ this .lastFrameTimeNanos = 0 ;
7173 Choreographer .getInstance ().postFrameCallback (this );
7274 }
7375}
Original file line number Diff line number Diff line change @@ -727,7 +727,7 @@ public void surfaceDestroyed(SurfaceHolder holder) {
727727 // Release this WorldWindow reference from World Wind's global message service.
728728 WorldWind .messageService ().removeListener (this );
729729
730- // Reset this WorldWindow 's internal state.
730+ // Reset the World Window 's internal state.
731731 this .reset ();
732732 }
733733
@@ -743,9 +743,11 @@ public void onPause() {
743743 // Mark the World Window as paused.
744744 this .isPaused = true ;
745745
746- // The OpenGL thread is paused, so frames in the queue will not be processed. Clear the frame queue and recycle
747- // pending frames back into the frame pool.
748- this .clearFrameQueue ();
746+ // Reset the World Window's internal state. The OpenGL thread is paused, so frames in the queue will not be
747+ // processed. Clear the frame queue and recycle pending frames back into the frame pool. We also don't know
748+ // whether or not the render resources are valid, so we reset and let the GLSurfaceView establish the new
749+ // EGL context and viewport.
750+ this .reset ();
749751 }
750752
751753 /**
@@ -758,9 +760,6 @@ public void onResume() {
758760
759761 // Mark the World Window as not paused.
760762 this .isPaused = false ;
761-
762- // Redraw the World Window.
763- this .requestRedraw ();
764763 }
765764
766765 @ Override
You can’t perform that action at this time.
0 commit comments