diff options
author | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-11-16 23:19:12 +0100 |
---|---|---|
committer | faketruth <faketruth@0a769ca7-a7f5-676a-18bf-c427514a06d6> | 2012-11-16 23:19:12 +0100 |
commit | 6aa243a9533793b6005fd1c7780e9656bb847395 (patch) | |
tree | a9d203812289091a67a09c150fb54aff472002b2 /Android/src/com/mcserver/MCServerActivity.java | |
parent | Android: Made the initial pre-calculated spawn area smaller (diff) | |
download | cuberite-6aa243a9533793b6005fd1c7780e9656bb847395.tar cuberite-6aa243a9533793b6005fd1c7780e9656bb847395.tar.gz cuberite-6aa243a9533793b6005fd1c7780e9656bb847395.tar.bz2 cuberite-6aa243a9533793b6005fd1c7780e9656bb847395.tar.lz cuberite-6aa243a9533793b6005fd1c7780e9656bb847395.tar.xz cuberite-6aa243a9533793b6005fd1c7780e9656bb847395.tar.zst cuberite-6aa243a9533793b6005fd1c7780e9656bb847395.zip |
Diffstat (limited to 'Android/src/com/mcserver/MCServerActivity.java')
-rw-r--r-- | Android/src/com/mcserver/MCServerActivity.java | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/Android/src/com/mcserver/MCServerActivity.java b/Android/src/com/mcserver/MCServerActivity.java index 38b566250..8a9846ca1 100644 --- a/Android/src/com/mcserver/MCServerActivity.java +++ b/Android/src/com/mcserver/MCServerActivity.java @@ -16,6 +16,8 @@ import android.net.Uri; import android.os.Bundle; import android.util.Log; import android.view.KeyEvent; +import android.view.Menu; +import android.view.MenuItem; import android.view.View; import android.widget.ArrayAdapter; import android.widget.Button; @@ -31,13 +33,17 @@ public class MCServerActivity extends Activity { ArrayList<String> mLogList = new ArrayList<String>(); ArrayAdapter<String> mAdapter; + MCServerInstaller mInstaller = null; + + final private int MENU_REINSTALL = 0; + /** Called when the activity is first created. */ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); - Log.e("MCServer", "p id: " + android.os.Process.myPid() ); + //Log.e("MCServer", "p id: " + android.os.Process.myPid() ); ((Button)findViewById(R.id.start_server)).setOnClickListener( new View.OnClickListener() { @@ -135,12 +141,14 @@ public class MCServerActivity extends Activity { }); loggerThread.start(); + ((TextView)findViewById(R.id.ip_address)).setText("Connect to: " + getLocalIpAddress()); - - - - ((TextView)findViewById(R.id.ip_address)).setText("Connect to: " + getLocalIpAddress()); + mInstaller = new MCServerInstaller(this); + if( mInstaller.NeedsUpdate() ) + { + mInstaller.ShowFirstRunDialog(); + } } @@ -234,15 +242,32 @@ public class MCServerActivity extends Activity { - public void Testtt() - { - //Log.d("MCServer", "in Testtt"); + @Override + public boolean onCreateOptionsMenu(Menu menu) { + menu.add(0, MENU_REINSTALL, 0, "Reinstall MCServer" ); + return super.onCreateOptionsMenu(menu); } + @Override + public boolean onOptionsItemSelected(MenuItem item) { + + switch( item.getItemId() ) + { + case MENU_REINSTALL: + mInstaller.ShowPluginInstallDialog(true); + return true; + } + return false; + } + + + + + static { System.loadLibrary("mcserver"); } |