title: setOnClickListener android studio
body: <p>I´m learning Java in android studio with an online material</p>
  
  <p>But i got stucked at this simple program</p>
  
  <p>Android Studio says that there is error in this code, but i can not see them, here is the code:</p>
  
  <pre><code>package com.acmegames.listadecontatos;
  
  import android.os.Bundle;
  import android.support.v7.app.AppCompatActivity;
  import android.widget.*;
  import android.view.*;
  import android.app.*;
  
  
  public class ListaContatosActivity extends AppCompatActivity {
  
      ListView lista_contatos;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_lista_contatos);
  
          lista_contatos = (ListView) findViewById(R.id.lista_contatos);
  
          lista_contatos.setOnClickListener( new AdapterView.OnItemClickListener(){
  
              @Override
  
              public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {
  
                  String nome = ((TextView) view).getText().toString();
  
                  AlertDialog.Builder dialogo =  new AlertDialog.Builder(ListaContatosActivity.this);
                  dialogo.setTitle("Contato");
                  dialogo.setMessage("Contato selecionado: " + nome);
                  dialogo.setNeutralButton("Ok", null);
                  dialogo.show();
  
              }
  
          });
      }
  }
  </code></pre>