package com.example.agenda_java;
import androidx.appcompat.app.AppCompatActivity;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;
public class ListaAlunoActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_lista_aluno);
final EditText campoNome=findViewById(R.id.activity_formulario_aluno_nome);
final EditText campoTelefone=findViewById(R.id.activity_formulario_aluno_telefone);
final EditText campoEmail=findViewById(R.id.activity_formulario_aluno_email);
Button botaoSalvar = findViewById(R.id.activity_formulario_aluno_botao_salvar);
botaoSalvar.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
String nome = campoNome.getText().toString();
String telefone = campoTelefone.getText().toString();
String email = campoEmail.getText().toString();
Aluno alunoCriado = new Aluno(nome, telefone, email);
Toast.makeText(ListaAlunoActivity.this,
alunoCriado.getNome()+"-"
+ alunoCriado.getTelefone()+ "-"
+ alunoCriado.getEmail(), Toast.LENGTH_LONG).show();
}
});
}
}