[Solved] How to get the id resource id of a view in a List view
[ad_1] For your ListView, you can set an onItemClickListener as below ListView listView1 = (ListView) findViewById(R.id.listView1); listView1.setOnItemClickListener(new OnItemClickListener() { @Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { //With the position parameter, you can fetch the item at the clicked position like below. AnimalsListItems yourItem = (AnimalsListItems) listView1.getItemAtPosition(position); //Now you can assign … Read more