I looked everywhere and non of the answers helped me until one did.
What i did was create a HolderView and wrapped up all my textviews and other widgets in the getView mathod of the adpater:
put this class in:
static class ViewHolder
{
TextView text1;
TextView text2;
TextView text3;
}
and i also decalared the same ones normally as they are seperate now:
TextView text1;
TextView text2;
TextView text3;
then declare all the views and widgets after inflating the layout in getView:
holder = new ViewHolder();
holder.text1 = (TextView) vi.findViewById(R.id.textView2single);
holder.text2 = (TextView) vi.findViewById(R.id.textView3single);
holder.text3 = (TextView) vi.findViewById(R.id.textView4single);
inside the onClick method, i used:
View parentView = (View) v.getParent();
and then declared all my widgets again using this parentview:
text1 = (TextView) parentView.findViewById(R.id.textView2single);
text2 = (TextView) parentView.findViewById(R.id.textView3single);
text3 = (TextView) parentView.findViewById(R.id.textView4single);
In doing this im forcing my onClick to get the parent position of the list view item, therefore all widgets inside that parent can be called easily, then you can do what you like with it. This is the only way i have found that works.
setOnItemClickListener()
on listview if u need only row id – Examinee