public void destroy() { if (app != null) { app.destroy(); } if (finishOnAppStop) { finish(); } }
@Override protected void onResume() { logger.fine("onResume"); super.onResume(); gainFocus(); }
@Override protected void onPause() { logger.fine("onPause"); loseFocus(); super.onPause(); }
@Override public void onCreate(Bundle savedInstanceState) { initializeLogHandler(); requestWindowFeature(Window.FEATURE_NO_TITLE); getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN); } else { if (!screenShowTitle) { requestWindowFeature(Window.FEATURE_NO_TITLE); final DataObject data = (DataObject) getLastNonConfigurationInstance(); if (data != null) { logger.log(Level.FINE, "Using Retained App"); WindowManager wind = this.getWindowManager(); Display disp = wind.getDefaultDisplay(); Log.d("AndroidHarness", "Resolution from Window, width:" + disp.getWidth() + ", height: " + disp.getHeight()); app.start(); } catch (Exception ex) { handleError("Class " + appClass + " init failed", ex); setContentView(new TextView(this)); layoutDisplay();
@Override protected void onDestroy() { logger.fine("onDestroy"); final DataObject data = (DataObject) getLastNonConfigurationInstance(); if (data != null || inConfigChange) { logger.fine("In Config Change, not stopping app."); } else { if (app != null) { app.stop(!isGLThreadPaused); } } setContentView(new TextView(this)); ctx = null; app = null; view = null; JmeAndroidSystem.setView(null); super.onDestroy(); }
splashImageView = new ImageView(this); Drawable drawable = this.getResources().getDrawable(splashPicID); if (drawable instanceof NinePatchDrawable) { splashImageView.setBackgroundDrawable(drawable); setContentView(frameLayout); logger.log(Level.FINE, "Splash Screen Created"); } else { logger.log(Level.FINE, "Splash Screen Skipped."); setContentView(view);
/** * Called by the android alert dialog, terminate the activity and OpenGL * rendering * * @param dialog * @param whichButton */ public void onClick(DialogInterface dialog, int whichButton) { if (whichButton != -2) { if (app != null) { app.stop(true); } app = null; this.finish(); } }