Пример #1
0
    @Override
    public void onClick(View v) {

      User user = users.get(position);
      Intent intent = new Intent(context, UserDetailActivity.class);
      intent.putExtra("memberId", user.getMemberId());
      context.startActivity(intent);
    }
Пример #2
0
 @Override
 public View getView(int position, View convertView, ViewGroup parent) {
   // TODO Auto-generated method stub
   ViewHolder mHolder;
   View view = convertView;
   if (view == null) {
     view = inflater.inflate(R.layout.want_see_user_item, null);
     mHolder = new ViewHolder();
     mHolder.wantSeeView = (LinearLayout) view.findViewById(R.id.want_see_view);
     mHolder.userImage = (RoundImageView) view.findViewById(R.id.user_image);
     mHolder.userNick = (TextView) view.findViewById(R.id.user_nick);
     view.setTag(mHolder);
   } else {
     mHolder = (ViewHolder) view.getTag();
   }
   // 获取position对应的数据
   User user = getItem(position);
   imageLoaderCache.displayImage(
       user.getPortrait(), mHolder.userImage, NarutoApplication.imageOptions);
   mHolder.userNick.setText(StringUtil.getShortStr(user.getNickname(), 3));
   mHolder.userImage.setOnClickListener(new UserSelectAction(position));
   return view;
 }