não consigo vê o que esta errado nesse código
package cadastro.caelum.com.br.cadastrocaelum;
import android.app.Activity; import android.os.Bundle; import android.view.Menu; import android.view.View; import android.widget.AdapterView; import android.widget.ArrayAdapter; import android.widget.ListView; import android.widget.Toast;
class ListaAlunosActivity extends Activity { @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.listagem_alunos);
ListView lista = (ListView) findViewById(R.id.lista);
final String[] alunos = {"Suelen", "Guilherme", "Mauricio"};
ArrayAdapter adapter = new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, alunos);
lista.setAdapter(adapter);
lista.setOnItemClickListener(new AdapterView.OnItemClickListener() { @Override public void onItemClick(AdapterView<?> adapter, View view, int posicao, long id) {
Toast.makeText(ListaAlunosActivity.this, "A posiçao é" + posicao , Toast.LENGTH_SHORT).show(); } });
lista.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> parent, View view, int posicao, long id) { Toast.makeText(ListaAlunosActivity.this, "Aluno clicado é" + alunos[posicao], Toast.LENGTH_SHORT).show(); return true; } })
public boolean onCreateOptionsMenu(Menu, menu);{
return super.onCreateOptionsMenu(menu); }
} }