From d90f6e7e181dd5eeb7347e1bde3a24cc74d3754c Mon Sep 17 00:00:00 2001 From: "kim..ng" Date: Tue, 12 Jul 2011 09:52:35 +0000 Subject: [PATCH] Android: Allow custom app instantiation git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7851 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../src/android/com/jme3/app/AndroidHarness.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/engine/src/android/com/jme3/app/AndroidHarness.java b/engine/src/android/com/jme3/app/AndroidHarness.java index 021562375..e92cf238a 100644 --- a/engine/src/android/com/jme3/app/AndroidHarness.java +++ b/engine/src/android/com/jme3/app/AndroidHarness.java @@ -95,7 +95,7 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt protected int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR; protected OGLESContext ctx; - protected GLSurfaceView view; + protected GLSurfaceView view = null; protected boolean isGLThreadPaused = true; final private String ESCAPE_EVENT = "TouchEscape"; @@ -124,13 +124,13 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt // Create application instance try - { - app = null; - view = null; - - @SuppressWarnings("unchecked") - Class clazz = (Class) Class.forName(appClass); - app = clazz.newInstance(); + { + if (app == null) + { + @SuppressWarnings("unchecked") + Class clazz = (Class) Class.forName(appClass); + app = clazz.newInstance(); + } app.setSettings(settings); app.start();