MCServer should run just fine on Android now :D
The server is also stoppable from Android git-svn-id: http://mc-server.googlecode.com/svn/trunk@743 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -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();
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user