已经有段时间没有写博客记录一些知识点,有些东西写着写着就忘了,记录一下
这个问题理解了之后也不难,我刚学习Android 的时候碰到子控件的点击事件难受得要死,哈哈哈哈哈。现在依旧还是个菜鸟。
1.以下是适配器
public class MyPinlunAdapter extends BaseAdapter {
private Context context;
private List<MyCommentBean> jsonObjectList;
public MyPinlunAdapter(Context context, List<MyCommentBean> jsonObjectList) {
this.context = context;
this.jsonObjectList = jsonObjectList;
}
@Override
public int getCount() {
return jsonObjectList.size();
}
@Override
public Object getItem(int position) {
return jsonObjectList.get(position);
}
@Override
public long getItemId(int position) {
return position;
}
@Override
public View getView(final int position, View convertView, ViewGroup parent) {
final ViewHolder viewHolder;
if (convertView == null) {
viewHolder = new ViewHolder();
convertView = LayoutInflater.from(context).inflate(R.layout.item_punglun_gzm_list, null);
viewHolder.image_touxiang = (ImageView) convertView.findViewById(R.id.image_touxiang_gzm_details_list);
viewHolder.tv_pinglun_name = (TextView) convertView.findViewById(R.id.tv_pinglun_goods_details_gzm_details_list);
viewHolder.tv_time = (TextView) convertView.findViewById(R.id.tv_time_gzm_details_list);
viewHolder.tv_pinglun_neirong = (TextView) convertView.findViewById