Android: Allow custom app instantiation
git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7851 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
This commit is contained in:
parent
2f8ae09033
commit
d90f6e7e18
@ -95,7 +95,7 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
|
|||||||
protected int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR;
|
protected int screenOrientation = ActivityInfo.SCREEN_ORIENTATION_SENSOR;
|
||||||
|
|
||||||
protected OGLESContext ctx;
|
protected OGLESContext ctx;
|
||||||
protected GLSurfaceView view;
|
protected GLSurfaceView view = null;
|
||||||
protected boolean isGLThreadPaused = true;
|
protected boolean isGLThreadPaused = true;
|
||||||
final private String ESCAPE_EVENT = "TouchEscape";
|
final private String ESCAPE_EVENT = "TouchEscape";
|
||||||
|
|
||||||
@ -125,12 +125,12 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
|
|||||||
// Create application instance
|
// Create application instance
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
app = null;
|
if (app == null)
|
||||||
view = null;
|
{
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings("unchecked")
|
||||||
Class<? extends Application> clazz = (Class<? extends Application>) Class.forName(appClass);
|
Class<? extends Application> clazz = (Class<? extends Application>) Class.forName(appClass);
|
||||||
app = clazz.newInstance();
|
app = clazz.newInstance();
|
||||||
|
}
|
||||||
|
|
||||||
app.setSettings(settings);
|
app.setSettings(settings);
|
||||||
app.start();
|
app.start();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user