package com.example.jonathanmoreno.simpleapp;

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

public class MainActivity extends AppCompatActivity {


    EditText nameHolder ;
    Button enterBtn;


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



        nameHolder = (EditText)findViewById(R.id.editText);



        enterBtn = (Button) findViewById(R.id.button1);
        enterBtn.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Intent i = new Intent(MainActivity.this, Main2Activity.class);
                i.putExtra("yourName", nameHolder.getText().toString());
                startActivity(i);

            }
        });


    }



}


Create MainActivity.java