/*
Copyright (c) 2011-2013, Intel Corporation

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice,
      this list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright notice,
      this list of conditions and the following disclaimer in the documentation
      and/or other materials provided with the distribution.

    * Neither the name of Intel Corporation nor the names of its contributors
      may be used to endorse or promote products derived from this software
      without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package com.intel.multiconnect;

import java.util.ArrayList;
import java.util.EnumSet;

import android.app.AlertDialog;
import android.app.Dialog;
import android.app.ProgressDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.Intent;
import android.content.res.Configuration;
import android.graphics.BitmapFactory;
import android.os.Bundle;
import android.text.Editable;
import android.text.TextWatcher;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.TextView;

import com.intel.stc.events.StcException;
import com.intel.stc.lib.StcLib;
import com.intel.stc.lib.StcLib.NodeFlags;

import android.app.Activity;

/***
 * Main Activity
 */
public class MainActivity extends Activity implements OnClickListener{

	private Button clientButton = null;
	private Button serverButton = null;
	private Button discoveryNodesButton = null;
	
	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		
		setContentView(R.layout.menu);
		
		clientButton = (Button)findViewById(R.id.clientButton);
		clientButton.setOnClickListener(this);

		serverButton = (Button)findViewById(R.id.serverButton);
		serverButton.setOnClickListener(this);
		
		discoveryNodesButton = (Button)findViewById(R.id.discoveryButton);
		discoveryNodesButton.setOnClickListener(this);
	}

	//This is a callback on button click.
	@Override
	public void onClick(View view) {
		Intent intent;
		switch(view.getId()){
		
		case R.id.clientButton:
			intent = new Intent(MainActivity.this,ClientController.class);
			startActivity(intent);
			break;
		case R.id.serverButton:
			intent = new Intent(MainActivity.this,ServerController.class);
			startActivity(intent);
			break;
		case R.id.discoveryButton:
			intent = new Intent(MainActivity.this,DiscoveryNodeActivity.class);
			startActivity(intent);
			break;
		}
	}
}

@@ -2542,55 +2542,10 @@
 ll;%0A
-%09private Button discoveryNodesButton = null;%0A
 %09%0A
+
 %09@Ov
@@ -2885,129 +2885,8 @@
 s);%0A
-%09%09%0A%09%09discoveryNodesButton = (Button)findViewById(R.id.discoveryButton);%0A%09%09discoveryNodesButton.setOnClickListener(this);%0A
 %09%7D%0A%0A
@@ -3159,32 +3159,32 @@
 d.serverButton:%0A
+
 %09%09%09intent = new 
@@ -3273,144 +3273,8 @@
 ak;%0A
-%09%09case R.id.discoveryButton:%0A%09%09%09intent = new Intent(MainActivity.this,DiscoveryNodeActivity.class);%0A%09%09%09startActivity(intent);%0A%09%09%09break;%0A
 %09%09%7D%0A

Remove discovery button from the main menu