I have created a listview in which I fill with information from a database and I add a function to each element click
adapter = new ArrayAdapter(getApplicationContext(), R.layout.my_cutom_layout, villes);
listV.setAdapter(adapter);
listV.setBackgroundColor(Color.BLUE);
listV.setOnItemClickListener(new AdapterView.OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
Toast.makeText(getApplicationContext(), "On va à : "+(position+1)+" "+villes.get(position), Toast.LENGTH_SHORT).show();
String [] villeData = {getZone,""+(position+1) ,villes.get(position)};
intent.putExtra("ville", villeData);
startActivity(intent);
}
});
But when viewing the data, the click only works on top of the text and the whole row does not work the click