summaryrefslogtreecommitdiffstats
path: root/src/com/mcserver/MCServerActivity.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/com/mcserver/MCServerActivity.java39
1 files changed, 30 insertions, 9 deletions
diff --git a/src/com/mcserver/MCServerActivity.java b/src/com/mcserver/MCServerActivity.java
index f7bfc76e3..ff1a4fae2 100644
--- a/src/com/mcserver/MCServerActivity.java
+++ b/src/com/mcserver/MCServerActivity.java
@@ -2,35 +2,42 @@ package com.mcserver;
import android.app.Activity;
import android.os.Bundle;
+import android.util.Log;
import android.view.KeyEvent;
public class MCServerActivity extends Activity {
+ MainThread mThread = null;
+
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
- MainThread p = new MainThread();
- p.start();
+ mThread = new MainThread();
+ mThread.start();
}
- public boolean onKeyDown(int keyCode, KeyEvent event)
- {
+ public boolean onKeyDown(int keyCode, KeyEvent event) {
if(keyCode==KeyEvent.KEYCODE_BACK)
{
//android.os.Process.killProcess(android.os.Process.myPid());
- NativeCleanUp();
+ mThread.NativeCleanUp();
return super.onKeyDown(keyCode, event);
}
return false;
}
+ public void AddToLog( String logMessage ) {
+
+ }
+
static {
System.loadLibrary("mcserver");
}
- private static native void NativeCleanUp();
+
+
}
@@ -39,9 +46,23 @@ class MainThread extends Thread {
MainThread() {
}
+ public void AddToLog( String logMessage ) {
+ //Log.d("MCServer", "Add to log: " + logMessage);
+ }
+
+ public void TestTest(){
+ Log.d("MCServer", "in testtest");
+ }
+
public void run() {
NativeOnCreate();
}
-
- private static native void NativeOnCreate();
-} \ No newline at end of file
+ public native void NativeOnCreate();
+ public native void NativeCleanUp();
+}
+
+
+
+
+
+