summaryrefslogtreecommitdiffstats
path: root/src/com/mcserver/MCServerActivity.java
diff options
context:
space:
mode:
authorfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-16 22:28:14 +0200
committerfaketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-08-16 22:28:14 +0200
commit33ca4d5003059d7d1f4b9e29649693ec0e5be262 (patch)
tree7bfb4ec7c1d3fcc46c341406667033ec051f010c /src/com/mcserver/MCServerActivity.java
parentWindows compilation fix after Android changes (diff)
downloadcuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar.gz
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar.bz2
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar.lz
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar.xz
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.tar.zst
cuberite-33ca4d5003059d7d1f4b9e29649693ec0e5be262.zip
Diffstat (limited to '')
-rw-r--r--src/com/mcserver/MCServerActivity.java16
1 files changed, 13 insertions, 3 deletions
diff --git a/src/com/mcserver/MCServerActivity.java b/src/com/mcserver/MCServerActivity.java
index 225ba7a94..f7bfc76e3 100644
--- a/src/com/mcserver/MCServerActivity.java
+++ b/src/com/mcserver/MCServerActivity.java
@@ -2,6 +2,7 @@ package com.mcserver;
import android.app.Activity;
import android.os.Bundle;
+import android.view.KeyEvent;
public class MCServerActivity extends Activity {
/** Called when the activity is first created. */
@@ -12,16 +13,25 @@ public class MCServerActivity extends Activity {
MainThread p = new MainThread();
p.start();
-
- //NativeOnCreate();
}
+ public boolean onKeyDown(int keyCode, KeyEvent event)
+ {
+ if(keyCode==KeyEvent.KEYCODE_BACK)
+ {
+ //android.os.Process.killProcess(android.os.Process.myPid());
+ NativeCleanUp();
+ return super.onKeyDown(keyCode, event);
+ }
+ return false;
+ }
static {
System.loadLibrary("mcserver");
}
- private static native void NativeOnCreate();
+ private static native void NativeCleanUp();
+
}