@SuppressLint("NewApi") @Override protected View onGetItemView(ZhiBoBean item, int position, View convertView, ViewGroup parent) { ViewHolder holder; if (convertView == null) { convertView = mLayoutInflater.inflate(R.layout.adapter_item_zhibo, parent, false); holder = new ViewHolder(); holder.live_time = (TextView) convertView.findViewById(R.id.textView3); holder.imageview = (ImageView) convertView.findViewById(R.id.imageView123); holder.live_content = (TextView) convertView.findViewById(R.id.textView1); holder.head = (ImageView) convertView.findViewById(R.id.imageView1); holder.name = (TextView) convertView.findViewById(R.id.textView2); convertView.setTag(holder); } else { holder = (ViewHolder) convertView.getTag(); } holder.live_time.setText(JsonUtil.DayForChinese(item.getTime())); holder.live_content.setText(item.getContent()); holder.head.setImageResource(R.drawable.a); holder.name.setText("布林格"); if (null != item.getBmiddle_picURL() && !"".equals(item.getBmiddle_picURL())) { ImageLoader.getInstance().displayImage(item.getBmiddle_picURL(), holder.imageview, mOptionss); } return convertView; }
@Override public void onItemClick(AdapterView<?> parent, View view, int position, long id) { ZhiBoBean mBean = (ZhiBoBean) parent.getAdapter().getItem(position); if (null != mBean.getBigImageURL() && !"".equals(mBean.getBigImageURL())) { /** 方法2: */ Intent i = new Intent(); i.setClass(getActivity(), ShowImageViewActivity.class); i.putExtra("BigImageURL", mBean.getBigImageURL()); startActivity(i); } }