package br.com.alura.agenda;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.ListView;
import android.widget.Toast;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
public class MainActivity extends Activity {
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
List<String> alunos = new ArrayList<>(
Arrays.asList("Jorge Costa", "Paulo Eremita", "Deziele"));
ListView listaDeAlunos = findViewById(R.id.activity_main_lista_de_alunos);
listaDeAlunos.setAdapter(new ArrayAdapter<String>(
Context: this,
android.R.layout.simple_list_item_1,
alunos));