package com.example.patrice.rerservation01;

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

public class saisir_nom extends AppCompatActivity
{
    Button submit;
    EditText name;

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

        name = (EditText) findViewById(R.id.editText1);
        submit = (Button) findViewById(R.id.button);

        submit.setOnClickListener(new View.OnClickListener()
        {
            @Override
            public void onClick(View v) {
                if ( name.getText().toString().isEmpty() )
                {
                    Toast.makeText(getApplicationContext(), "Enter the Data", Toast.LENGTH_SHORT).show();
                }
                else
                {
                    String val = name.getText().toString();
                    Toast.makeText(getApplicationContext(), val , Toast.LENGTH_SHORT).show();
                }
            }
        });
    }
}