In your adapter, you should have a method called getItem(position)
So, in your onItemClickListener, the int arg2
means the position of the list that was clicked.
listView1.setOnItemClickListener(new AdapterView.OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,long id) {
Object object = adapter.getItem(position);
Toast.makeText(getActivity(), "item clicked id="+id, Toast.LENGTH_LONG).show();
}
});
So, this object might be your model, wich means that this object has every information you want. So, just take what you want.