android-project/app/src/main/java/org/libsdl/app/SDLActivity.java
changeset 12511 0ef0e4cb7752
parent 12507 6a5107360fbc
child 12513 efddb8c5e161
equal deleted inserted replaced
12510:6fb31043d8a8 12511:0ef0e4cb7752
   384             mHIDDeviceManager = null;
   384             mHIDDeviceManager = null;
   385         }
   385         }
   386 
   386 
   387         if (SDLActivity.mBrokenLibraries) {
   387         if (SDLActivity.mBrokenLibraries) {
   388            super.onDestroy();
   388            super.onDestroy();
   389            // Reset everything in case the user re opens the app
       
   390            SDLActivity.initialize();
       
   391            return;
   389            return;
   392         }
   390         }
   393 
   391 
   394         mNextNativeState = NativeState.PAUSED;
   392         mNextNativeState = NativeState.PAUSED;
   395         SDLActivity.handleNativeState();
   393         SDLActivity.handleNativeState();
   403             try {
   401             try {
   404                 SDLActivity.mSDLThread.join();
   402                 SDLActivity.mSDLThread.join();
   405             } catch(Exception e) {
   403             } catch(Exception e) {
   406                 Log.v(TAG, "Problem stopping thread: " + e);
   404                 Log.v(TAG, "Problem stopping thread: " + e);
   407             }
   405             }
   408             SDLActivity.mSDLThread = null;
       
   409 
       
   410             //Log.v(TAG, "Finished waiting for SDL thread");
       
   411         }
   406         }
   412 
   407 
   413         super.onDestroy();
   408         super.onDestroy();
   414 
       
   415         // Reset everything in case the user re opens the app
       
   416         SDLActivity.initialize();
       
   417     }
   409     }
   418 
   410 
   419     @Override
   411     @Override
   420     public void onBackPressed() {
   412     public void onBackPressed() {
   421         // Check if we want to block the back button in case of mouse right click.
   413         // Check if we want to block the back button in case of mouse right click.
  1709            Log.v("SDL", "Skip .. Surface is not ready.");
  1701            Log.v("SDL", "Skip .. Surface is not ready.");
  1710            SDLActivity.mIsSurfaceReady = false;
  1702            SDLActivity.mIsSurfaceReady = false;
  1711            return;
  1703            return;
  1712         }
  1704         }
  1713 
  1705 
       
  1706         /* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */
       
  1707         SDLActivity.onNativeSurfaceChanged();
       
  1708 
  1714         /* Surface is ready */
  1709         /* Surface is ready */
  1715         SDLActivity.mIsSurfaceReady = true;
  1710         SDLActivity.mIsSurfaceReady = true;
  1716 
       
  1717         /* If the surface has been previously destroyed by onNativeSurfaceDestroyed, recreate it here */
       
  1718         SDLActivity.onNativeSurfaceChanged();
       
  1719 
  1711 
  1720         SDLActivity.mNextNativeState = SDLActivity.NativeState.RESUMED;
  1712         SDLActivity.mNextNativeState = SDLActivity.NativeState.RESUMED;
  1721         SDLActivity.handleNativeState();
  1713         SDLActivity.handleNativeState();
  1722     }
  1714     }
  1723 
  1715