package edu.utexas.ee360p_teamproject;

import android.content.Intent;
import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;

public class MainActivity extends AppCompatActivity {

    public static final String EXTRA_MESSAGE = "com.example.chatroomclient.MESSAGE";


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        ///comment
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
    }

    public void enterRoom(View view){
        Intent intent = new Intent(this, ChatRoomActivity.class);
        EditText username = (EditText) findViewById(R.id.editUsername);
        String name = username.getText().toString();

        //send chosen chatroom to salesrep server
        // read port num back from server
        int pn=0; //pn = port num received from sales rep

        //connect client with server using portnumber


        Bundle extras = new Bundle();
        extras.putString("EXTRA_USERNAME", name);
        extras.putInt("EXTRA_PORTNUM",pn);
        intent.putExtras(extras);





        startActivity(intent);
    }


}

@@ -187,24 +187,91 @@
 .widget.
-EditText
+ArrayAdapter;%0Aimport android.widget.EditText;%0Aimport android.widget.Spinner
 ;%0A%0Apubli
@@ -537,24 +537,24 @@
 anceState);%0A
-
         setC
@@ -585,24 +585,439 @@
 vity_main);%0A
+%0A        Spinner roomSelector = (Spinner)findViewById(R.id.chatRoomSelector);%0A        //ask coordinator for available rooms in strings and replace rooms below with those strings%0A        String%5B%5D items = new String%5B%5D%7B%22Room 1%22, %22Room 2%22, %22Room 3%22%7D;%0A        ArrayAdapter%3CString%3E adapter = new ArrayAdapter%3CString%3E(this, android.R.layout.simple_spinner_dropdown_item, items);%0A        roomSelector.setAdapter(adapter);%0A%0A
     %7D%0A%0A    p

add java part for spinner