* Set AndroidHarness contentView to a TextView (not GLSurfaceView) onDestroy(), perhaps it will help with OOM issues

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@10551 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
sha..RD 12 years ago
parent 281f9b6c20
commit 8c1e5c9cf9
  1. 10
      engine/src/android/com/jme3/app/AndroidHarness.java

@ -170,7 +170,7 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
if (screenFullScreen) { if (screenFullScreen) {
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); WindowManager.LayoutParams.FLAG_FULLSCREEN);
} else { } else {
if (!screenShowTitle) { if (!screenShowTitle) {
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
@ -183,7 +183,6 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
if (data != null) { if (data != null) {
logger.log(Level.FINE, "Using Retained App"); logger.log(Level.FINE, "Using Retained App");
this.app = data.app; this.app = data.app;
} else { } else {
// Discover the screen reolution // Discover the screen reolution
//TODO try to find a better way to get a hand on the resolution //TODO try to find a better way to get a hand on the resolution
@ -212,8 +211,6 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
app.setSettings(settings); app.setSettings(settings);
app.start(); app.start();
} catch (Exception ex) { } catch (Exception ex) {
handleError("Class " + appClass + " init failed", ex); handleError("Class " + appClass + " init failed", ex);
setContentView(new TextView(this)); setContentView(new TextView(this));
@ -225,7 +222,6 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
// AndroidHarness wraps the app as a SystemListener. // AndroidHarness wraps the app as a SystemListener.
ctx.setSystemListener(this); ctx.setSystemListener(this);
layoutDisplay(); layoutDisplay();
} }
@Override @Override
@ -235,7 +231,6 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
if (app != null) { if (app != null) {
app.restart(); app.restart();
} }
} }
@Override @Override
@ -251,7 +246,6 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
if (view != null) { if (view != null) {
view.onResume(); view.onResume();
} }
if (app != null) { if (app != null) {
//resume the audio //resume the audio
AudioRenderer result = app.getAudioRenderer(); AudioRenderer result = app.getAudioRenderer();
@ -310,7 +304,6 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
} }
} }
isGLThreadPaused = true; isGLThreadPaused = true;
} }
@Override @Override
@ -330,6 +323,7 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
app.stop(!isGLThreadPaused); app.stop(!isGLThreadPaused);
} }
} }
setContentView(new TextView(this));
JmeAndroidSystem.setActivity(null); JmeAndroidSystem.setActivity(null);
ctx = null; ctx = null;
app = null; app = null;

Loading…
Cancel
Save