Android: Added an installer class that lets the user select default plugins to install and it will install the example.ini files.
Android: Added menu option to retry the MCServer install routine git-svn-id: http://mc-server.googlecode.com/svn/trunk@1050 0a769ca7-a7f5-676a-18bf-c427514a06d6
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
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");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user