为了账号安全,请及时绑定邮箱和手机立即绑定

安卓开发app里一些代码不懂 能不能尽可能地注释!每一行写清楚一些!求大神

安卓开发app里一些代码不懂 能不能尽可能地注释!每一行写清楚一些!求大神

cuni 2016-12-14 22:52:20
public View getView(int position, View convertView, ViewGroup parent) { ViewHolder holder = null; final Shop shop= mData.get(position); if (convertView == null) { holder=new ViewHolder(); convertView = mInflater.inflate(R.layout.shop_list, null); holder.shop_ll = (LinearLayout)convertView.findViewById(R.id.shop_ll); holder.img = (ImageView)convertView.findViewById(R.id.img); holder.name_tv = (TextView)convertView.findViewById(R.id.name_tv); holder.score_tv = (TextView)convertView.findViewById(R.id.score_tv); convertView.setTag(holder); }else { holder = (ViewHolder)convertView.getTag(); } holder.img.setBackgroundResource((Integer) shop.pic); holder.name_tv.setText((String) shop.name); holder.score_tv.setText("评分:"+shop.score); holder.shop_ll.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { //进入指定店铺 Intent intent = new Intent(); //指定店铺名 intent.putExtra("name", shop.name); intent.setClass(getActivity(), ShopActivity.class); startActivity(intent); } }); return convertView; }
查看完整描述

2 回答

  • 2 回答
  • 0 关注
  • 1567 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信