Android: added customizable messages to exit dialog

git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@7689 75d07b2b-3a1a-0410-a2c5-0572b91ccdca
3.0
kim..ng 14 years ago
parent 38eb3de309
commit f230997d93
  1. 15
      engine/src/android/com/jme3/app/AndroidHarness.java

@ -46,7 +46,16 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
* ConfigType.BEST is RGBA8888 or better if supported by the hardware
*/
protected ConfigType eglConfigType = ConfigType.FASTEST;
/**
* Title of the exit dialog, default is "Do you want to exit?"
*/
protected String exitDialogTitle = "Do you want to exit?";
/**
* Message of the exit dialog, default is "Use your home key to bring this app into the background or exit to terminate it."
*/
protected String exitDialogMessage = "Use your home key to bring this app into the background or exit to terminate it.";
protected OGLESContext ctx;
protected GLSurfaceView view;
@ -200,10 +209,10 @@ public class AndroidHarness extends Activity implements TouchListener, DialogInt
{
AlertDialog dialog = new AlertDialog.Builder(AndroidHarness.this)
// .setIcon(R.drawable.alert_dialog_icon)
.setTitle("Do you want to exit?")
.setTitle(exitDialogTitle)
.setPositiveButton("Yes", AndroidHarness.this)
.setNegativeButton("No", AndroidHarness.this)
.setMessage("Use your home key to bring this app into the background or exit to terminate it.")
.setMessage(exitDialogMessage)
.create();
dialog.show();
}

Loading…
Cancel
Save