Esempio n. 1
1
  @Override
  protected void onDestroy() {
    Log.v("SDL", "onDestroy()");

    if (SDLActivity.mBrokenLibraries) {
      super.onDestroy();
      // Reset everything in case the user re opens the app
      SDLActivity.initialize();
      return;
    }

    // Send a quit message to the application
    SDLActivity.mExitCalledFromJava = true;
    SDLActivity.nativeQuit();

    // Now wait for the SDL thread to quit
    if (SDLActivity.mSDLThread != null) {
      try {
        SDLActivity.mSDLThread.join();
      } catch (Exception e) {
        Log.v("SDL", "Problem stopping thread: " + e);
      }
      SDLActivity.mSDLThread = null;

      // Log.v("SDL", "Finished waiting for SDL thread");
    }

    super.onDestroy();
    // Reset everything in case the user re opens the app
    SDLActivity.initialize();
  }
Esempio n. 2
0
  @Override
  protected void onDestroy() {
    super.onDestroy();
    Log.v("SDL", "onDestroy()");
    // Send a quit message to the application
    SDLActivity.nativeQuit();

    // Now wait for the SDL thread to quit
    if (mSDLThread != null) {
      try {
        mSDLThread.join();
      } catch (Exception e) {
        Log.v("SDL", "Problem stopping thread: " + e);
      }
      mSDLThread = null;

      // Log.v("SDL", "Finished waiting for SDL thread");
    }
  }
Esempio n. 3
0
  // Called when we lose the surface
  public void surfaceDestroyed(SurfaceHolder holder) {
    // Log.v("SDL", "surfaceDestroyed()");

    // Send a quit message to the application
    SDLActivity.nativeQuit();

    // Now wait for the SDL thread to quit
    if (mSDLThread != null) {
      try {
        mSDLThread.join();
      } catch (Exception e) {
        Log.v("SDL", "Problem stopping thread: " + e);
      }
      mSDLThread = null;

      // Log.v("SDL", "Finished waiting for SDL thread");
    }

    enableSensor(Sensor.TYPE_ACCELEROMETER, false);
  }