I have a code that I get the ID of the item clicked on ListView
and step to another Activity
, but I would like to get the name clicked and not the ID.
My code:
if (controle != null) {
controle.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> av, View v, int position, long id) {
Intent it = new Intent(layout_projetos_c.this, layout_projetos_c_info.class);
it.putExtra("idProjeto", id);
startActivityForResult(it, 1);
}
});
}
And in the other Activity I get the value of the id
long idCli;
idCli = getIntent().getLongExtra("idProjeto", 0);
How can I get the name of the selected item instead of the ID?