My app is a list of firms, each firm is a row in my listview that shows: picture, name and phone (by adapter). Everything is working! But when I click in a item of my listview, it should start another activity
that shows page with firm details. I'm having trouble with onitemclick listener
(it doesn't work):
empresa = firm (in portuguese) lv = my listview
lv.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view,int position, long id) {
Intent i = new Intent (getApplicationContext(), detalheEmpresas.class );
Empresas empresa = (Empresas) parent.getItemAtPosition(position);
i.putExtra("Nome", empresa.getTitle().toString());
startActivity(i); }});
my detalheEmpresas activity
public class detalheEmpresas extends Activity {
@Override
public void onCreate (Bundle savedInstanceState){
super.onCreate(savedInstanceState);
this.setContentView(R.layout.detalhes_empresa);
Intent i = getIntent();
String nome = i.getStringExtra("Nome");
TextView NOME = (TextView) findViewById(R.id.Nome);
NOME.setText(nome);
}}