I have a ListView in my activity.
Each row includes three TextViews in this pattern: (RowId) (Name) (Phone number)
I need to get row id when user clicks on a row. I did so many things and search the net, however i didn’t find a solution. I have no idea how to get row id from following method:
listView = (ListView) findViewById(R.id.listview);
listView.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
Log.i(TAG, "item " + position + " clicked.");
}
});
Any suggestion would be appreciated.
You also could use
v.findViewById(R.id.yourTextViewId)