如何在列表视图中获取行视图数据

con*_*ive 1 android android-layout

这个例子:http: //saigeethamn.blogspot.com/2010/04/custom-listview-android-developer.html.在custom_row_view.xml中有3个textview id.使用onListItemClick时,一个位置列表项内有3行数据.如何提取这些数据?如何使用id?无论如何,当单击列表项时,在列表视图中获取行视图数据[protected void onListItemClick(ListView l,View v,int position,long id)?

Ron*_*nie 5

参数View v本身就是行视图.您可以通过致电获取附加数据v.getTag().应该在适配器的getView中使用它来设置它v.setTag(Object)